- 论坛徽章:
- 0
|
DB2 中的 bind 是干什么用的?
bldmapp 的文件内容:
@echo off
rem (C) COPYRIGHT International Business Machines Corp. 1996, 2000
rem All Rights Reserved.
rem
rem US Government Users Restricted Rights - Use, duplication or
rem disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
rem bldmapp.bat -- Windows 32-bit operating systems
rem Builds a Microsoft Visual C++ application program
rem Usage: bldmapp prog_name [ db_name [ userid password ]]
if exist "%1.sqx" goto embedded
if exist "%1.sqc" goto embedded
goto non_embedded
:embedded
rem Precompile and bind the program.
call embprep %1 %2 %3 %4
rem Compile the program.
if exist "%1.cxx" goto cpp_emb
cl -Z7 -Od -c -W2 -D_X86_=1 -DWIN32 %1.c utilemb.c
goto link_embedded
:cpp_emb
cl -Z7 -Od -c -W2 -D_X86_=1 -DWIN32 %1.cxx utilemb.cxx
rem Link the program.
:link_embedded
link -debug:full -debugtype:cv -out:%1.exe %1.obj utilemb.obj db2api.lib
goto exit
:non_embedded
rem Compile the program.
if exist "%1.cxx" goto cpp_non
cl -Z7 -Od -c -W2 -D_X86_=1 -DWIN32 %1.c utilapi.c
goto link_non_embedded
:cpp_non
cl -Z7 -Od -c -W2 -D_X86_=1 -DWIN32 %1.cxx utilapi.cxx
rem Link the program.
:link_non_embedded
link -debug:full -debugtype:cv -out:%1.exe %1.obj utilapi.obj db2api.lib
:exit
@echo on
embprep.bat 的内容,产生bind的文件
@echo off
rem (C) COPYRIGHT International Business Machines Corp. 1997, 2000
rem All Rights Reserved.
rem
rem US Government Users Restricted Rights - Use, duplication or
rem disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
rem embprep.bat -- Windows 32-bit operating systems
rem Prep and binds a C/C++ or Micro Focus COBOL embedded SQL program.
rem Usage: embprep <prog_name>; [ <db_name>; [ <userid>; <password>; ]]
rem Connect to a database.
if "%1" == "" goto error
if "%2" == "" goto case1
if "%3" == "" goto case2
if "%4" == "" goto error
goto case3
:case1
db2 connect to ipddb
goto prep_step
:case2
db2 connect to %2
goto prep_step
:case3
db2 connect to %2 user %3 using %4
:prep_step
if exist "%1.sqx" goto cpp
if exist "%1.sqb" goto cob
db2 prep %1.sqc bindfile
if exist "utilemb.sqc" db2 prep utilemb.sqc
goto bind_step
:cpp
db2 prep %1.sqx bindfile
if exist "utilemb.sqx" db2 prep utilemb.sqx
goto bind_step
:cob
db2 prep %1.sqb bindfile
:bind_step
db2 bind %1.bnd
db2 connect reset
goto exit
:error
echo Usage: embprep prog_name [ db_name [ userid password ]]
:exit
@echo on |
|