免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 21758 | 回复: 13
打印 上一主题 下一主题

DB2 中的 bind 是干什么用的? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-06-25 17:05 |只看该作者 |倒序浏览
各位大大:对于DB2的一些概念我不是很明确,请高手给予指点,先谢谢了:
    bind 命令的语法我能够查到,但是应该在什么时候使用它呢?它能起到什么作用?我检索到很多 .bnd 文件,它们不是完全的文本文件,那么我可以用什么方法生成自己的 .bnd 文件吗?

论坛徽章:
0
2 [报告]
发表于 2003-06-25 19:17 |只看该作者

DB2 中的 bind 是干什么用的?

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

论坛徽章:
0
3 [报告]
发表于 2003-06-27 09:09 |只看该作者

DB2 中的 bind 是干什么用的?

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

论坛徽章:
0
4 [报告]
发表于 2003-06-27 09:37 |只看该作者

DB2 中的 bind 是干什么用的?

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

论坛徽章:
0
5 [报告]
发表于 2003-06-29 18:04 |只看该作者

DB2 中的 bind 是干什么用的?

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

论坛徽章:
0
6 [报告]
发表于 2003-06-30 16:06 |只看该作者

DB2 中的 bind 是干什么用的?

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

论坛徽章:
0
7 [报告]
发表于 2003-07-01 08:49 |只看该作者

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

论坛徽章:
0
8 [报告]
发表于 2003-07-01 14:08 |只看该作者

DB2 中的 bind 是干什么用的?

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

论坛徽章:
0
9 [报告]
发表于 2003-07-02 16:28 |只看该作者

DB2 中的 bind 是干什么用的?

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

论坛徽章:
0
10 [报告]
发表于 2003-07-03 10:21 |只看该作者

DB2 中的 bind 是干什么用的?

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

cli、sqc、api,我可一个都还没有用过,呵呵,听起来似乎不是很容易吧,不过既然选择了这一行,就要付出努力,才能有收获。我们大家一起努力,共同进步吧!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP