足球小子 发表于 2003-06-25 17:05

DB2 中的 bind 是干什么用的?

:?: 各位大大:对于DB2的一些概念我不是很明确,请高手给予指点,先谢谢了:
    bind 命令的语法我能够查到,但是应该在什么时候使用它呢?它能起到什么作用?我检索到很多 .bnd 文件,它们不是完全的文本文件,那么我可以用什么方法生成自己的 .bnd 文件吗?

永远是新手 发表于 2003-06-25 19:17

DB2 中的 bind 是干什么用的?

如果DB2打了补丁,那么需要做BIND,让已有的程序利用新的补丁提供的内容

Law 发表于 2003-06-27 09:09

DB2 中的 bind 是干什么用的?

你可以试一下,bldmapp,这个就可以产生你自己的绑定文件

足球小子 发表于 2003-06-27 09:37

DB2 中的 bind 是干什么用的?

:D:D 谢谢两位大大,可是 bldmapp 这个命令的语法格式我找不到,DB2的信息中心我认为做的不是很好,用起来很不顺手,不如微软系列的帮助。
   可以麻烦一下举一个小例子吗?先谢谢了!!

Law 发表于 2003-06-29 18:04

DB2 中的 bind 是干什么用的?

你进入信息中心,搜索一下 bldmapp 就可以了

足球小子 发表于 2003-06-30 16:06

DB2 中的 bind 是干什么用的?

:x 哈哈,看来我是很笨,在信息中心中也没有搜索出来,不论是“Search DB2 Online Information”还是“Find...”,都没有结果。 :oops:

Law 发表于 2003-07-01 08:49

DB2 中的 bind 是干什么用的?

bldmapp 的文件内容:


@echo off
rem(C) COPYRIGHT International Business Machines Corp. 1996, 2000
remAll Rights Reserved.
rem
remUS Government Users Restricted Rights - Use, duplication or
remdisclosure 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
remCompile 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
remCompile 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
remAll Rights Reserved.
rem
remUS Government Users Restricted Rights - Use, duplication or
remdisclosure 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

足球小子 发表于 2003-07-01 14:08

DB2 中的 bind 是干什么用的?

谢谢Law及其他各位的指点,我有点明白了,只是我现在对DB2的理解还仅处于初级管理员阶段,没有做过基于DB2的开发,我想要真正去编几个程序才能完全明白吧?任重而道远啊。

Law 发表于 2003-07-02 16:28

DB2 中的 bind 是干什么用的?

可以,,我主要是在做db2上面的开发,一般只是用用cli和sqc 还有api,如果有什么问题可以发邮件,我们一起交流

足球小子 发表于 2003-07-03 10:21

DB2 中的 bind 是干什么用的?

原帖由 "Law"]可以,,我主要是在做db2上面的开发,一般只是用用cli和sqc 还有api,如果有什么问题可以发邮件,我们一起交流
   

cli、sqc、api,我可一个都还没有用过,呵呵,听起来似乎不是很容易吧,不过既然选择了这一行,就要付出努力,才能有收获。我们大家一起努力,共同进步吧!
页: [1] 2
查看完整版本: DB2 中的 bind 是干什么用的?