通信系统连接db2数据库使用的是配置文件,用的不是db2 编目的方法。
db2inst1@TEST_APP1 $ db2cli validate -dsn TESTDSN

===============================================================================
Client information for the current copy:
===============================================================================

Client Package Type       : IBM Data Server Client
Client Version (level/bit): DB2 v10.5.0.0 (s130528/64-bit)
Client Platform           : AIX 64BIT
Install/Instance Path     : /opt/IBM/db2/V10.5
DB2DSDRIVER_CFG_PATH value: <not-set>
db2dsdriver.cfg Path      : /home/db2inst1/sqllib/cfg/db2dsdriver.cfg
DB2CLIINIPATH value       : <not-set>
db2cli.ini Path           : /home/db2inst1/sqllib/cfg/db2cli.ini
db2diag.log Path          : /home/db2inst1/sqllib/db2dump/db2diag.log

===============================================================================
db2dsdriver.cfg schema validation for the entire file:
===============================================================================

Success: The schema validation completed successfully without any errors.

===============================================================================
db2cli.ini validation for data source name "TESTDSN":
===============================================================================

[ Keywords used for the connection ]

Keyword                   Value
---------------------------------------------------------------------------
TABLETYPE                 TABLE
AUTOCOMMIT                0

===============================================================================
db2dsdriver.cfg validation for data source name "TESTDSN":
===============================================================================

[WARNING] Database entry for dsn is missing in IBM Data Server Configuration
file.

===============================================================================

[ Parameters used for the connection ]

Keywords                  Valid For     Value
---------------------------------------------------------------------------
DATABASE                  CLI,.NET,ESQL TEST
HOSTNAME                  CLI,.NET,ESQL TEST_DB1
PORT                      CLI,.NET,ESQL 60000
COMMPROTOCOL              CLI           TCPIP
USERID                    CLI,.NET      userdbs
PASSWORD                  CLI,.NET      *******

===============================================================================
The validation is completed.
===============================================================================

db2inst1@TEST_APP1 $ echo "select count(1) from syscat.tables"|db2cli execsql -dsn testdsn
IBM DATABASE 2 Interactive CLI Sample Program
(C) COPYRIGHT International Business Machines Corp. 1993,1996
All Rights Reserved
Licensed Materials - Property of IBM
US Government Users Restricted Rights - Use, duplication or
disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
> select count(1) from syscat.tables
FetchAll:  Columns: 1
1
1103
FetchAll: 1 rows fetched.

最近写的一个程序需要 连接 一个 DB2 数据库 上去,配置环境的时候走了不少弯路,看了N多文档,搞了近两天,终于搞好了,在这里记录下:先说明:系统是centos linux 5.x,64位,系统上的php是5.3,python的版本我有安装python 2.6的。下载地址:https://www-304.ibm.com/support/docview.wss?uid=swg27016878我下载下来的包... 在非 Java DB2 客户机中配置安全套接字层 (SSL) 支持 可以将诸如 CLI、CLP 和 .Net Data Provider 客户机之类的 DB2 ® 数据库 客户机配置为支持安全套接字层 (SSL) 以便与 DB2 服务器进行通信。 注: 如果 V9.7 的 DB2 客户机或 DB2 Connect™ 服务器与 z/OS® V1.8、V1.9 或 V1.10 系统上 DB2 z/OS 版服务器建立 SSL 连接 ,那么必须将 APAR PK72201 的相应 PTF 应用于 Commun 简介-为什么要进行JDBC跟踪? JDBC跟踪是一种为Java应用程序开发人员提供有价值的信息,以帮助他们进行 数据库 应用程序开发工作的 方法 。 以下是一些需要了解如何执行JDBC跟踪的实例示例: 搜索程序逻辑或初始化错误- 数据库 连接 可能由于URL错误而失败,一次又一次地调用预期要执行的查询,由于事务定义不正确而可能导致 数据库 不一致,并且以此类推。 在所有这些情况下,很有可能可以使用跟踪... 2. 安装 DB2 for ODBC and CLI drivera) 在ibm官网上下载,v9.7fp8_aix64_odbc_cli.tar.gzb) 解压这个文件,然后进去解压后的目录,目录结构如下图所示:c) 执行下面几条命令:export PATH=$PATH:/Oracle/odbc_cli/clidriver/binexport LD_LIBRARY_PATH=$LD_LIBRARY_... For x86(32bit): https://www-933.ibm.com/support/fixcentral/swg/selectFixes?parent=ibm%2FInformation%2BManagement&product=ibm/Information+Management/IBM+Data+ 安装注意事项: 1. DB2 10.5以上的版本中自带了Spatial Extender 模块,因此不用单独安装Spatial Extender 安装包了,但是需要选择:“定制安装”,而非“典型安装”,并且手动选择安装Spatial Extender 模... 1 Download and InstallDownload DB2 CLI ODBC Driver:for x86 (32bit):https://delivery04.dhe.ibm.com/sdfdl/v2/sar/CM/IM/04qs9/0/Xa.2/Xb.jusyLTSp44S03o2gwPADMzlDcfeJnsfCE8Y8a4irGv6duELOADVNn04YxvA/Xc.CM/I... go- db2 -example ibm db2 是款商用的db,默认支持的 程语言中没有Go,也没有介绍过,今天就演示下Go通过odbc方式 连接 ibm db2 的例子。 DB2 ODBC driver 安装 DB2 ODBC driver DB2 ODBC driver的来源有一下几种: db2 安装包自带odbc驱动,和常用的jdbc驱动一样,... #!/bin/python#coding=gb18030import DB2 dsn="driver={IBM DB2 ODBC DRIVER };database=%s;hostname=%s;port=%s;protocol=tcpip;"%("dbsync","192.168.19.55","50000")conn = DB2 .connect(dsn,"administrator"," db2 "... DSNDB01: DB2 directoty databaseDSNDB04: Store objects that users create without explicitly indicating the database the objects belong toDSNDB06: DB2 catalog database DSNDB0 关于最原始时的理解是,window上 连接 数据库 要先去控制面板配DSN,以让程序能找到 数据库 。我想现在虽然是简单的这么一句表述,但对于最开始没有任何这方面经验的人来,确是一个很大沟,难以理解:“DSN是什么东西,怎么操作?”就算图书馆的某本书上有点零星的介绍,但也不会完全理解和掌握。配合 DB2 的经验基础,我认为,其实就是做一个“ 目”,术语叫做“catalog”,但是对于 DB2 来说,本地 参考:http://www.withdata.com/blog/tips/how-to-install-and-configure- db2 -odbc-driver.html 驱动下载地址:https://www-933.ibm.com/support/fixcentral/swg/selectFixes?parent=ibm%2FInformation%2BManagement&prod...