 | 级别: 初级 Susan Cline, Cloudscape 社区开发人员, IBM
2004 年 9 月 23 日 2005 年 8 月 18 日 更新 ODBC 可以作为 IBM® DB2 Run-Time Client,用于 Cloudscape 10.x 和 Derby 数据库。配合 Derby, Version 10.1 及 10.0 使用的 ODBC 在 Windows 平台上已经可以运行,在 Linux 平台上也已经有 beta 版本。本文将讨论平台、系统需求,以及从哪里可以下载这个免费的驱动程序。
用于 Cloudscape 和 Derby 10.0 及 10.1 数据库的 ODBC
通过可免费下载的 DB2 Run-Time Client,ODBC 应用程序可以将 IBM Cloudscape, Version 10.1 和 Apache Derby 数据库用作后端数据源。此外,这个 Run-Time Client 提供了一个命令行界面,即 DB2 Command Line Processor (CLP),通过 CLP,可以在一个 Derby 数据库上执行 SQL 语句。
Run-Time Client 与 Run-Time Client Lite
8.2 版的 DB2 Run-Time Client 可以是用于多个平台的完整版,用于 Windows 的 Lite 版,或者用于 Linux 的 Minimal 版。所有这些版本都提供了对 Cloudscape 和 Derby 数据库的 ODBC 支持,但是,根据自身的需要,您可能想安装完整版,或安装更小的版本。下面是对两者的一个比较。不管安装哪一种版本,在一台主机上只能安装一种版本。下面的信息可以帮助您决定安装哪个版本。
在 Windows 上使用 Cloudscape 10.0 及 10.1 与 DB2 Run-Time Clients 是一个受支持的平台,想要或者已经购买技术支持的 Cloudscape 客户在使用 Cloudscape 和 DB2 Run-Time Client 时可以获得相应的帮助。
注意:在 Linux 上使用 Cloudscape 与 DB2 Run-Time Client 还是 beta 版本。要报告问题或者询问使用该产品组合方面的问题,请访问 Cloudscape Developers Forum。
表 1. DB2 Run-Time Client 中的不同点,完整版与 Lite/Minimal 版 Version 8.2
| | 数据库支持 | 平台支持 | 功能差别 | 下载大小 | 相对于完整版的局限性 | | Lite 版 | Cloudscape, Version 10.1
Apache Derby, Version 10.1
Cloudscape, Version 10.0 Final Release
Apache Derby, Version 10.0
DB2 Family Servers | Windows 2000, Windows 2003, Windows XP
经测试的平台:
| ODBC 支持
CLI 支持
OLE DB
.NET Data provider
JDBC
DB2 CLP - Command Line Processor
Redistributable Developer's License | 15.0 MB | 没有 Configuration Assistant - 没有 GUI,只有 Command Line Interface (CLI/ODBC)
在 Windows 上只有 TCP/IP 和 Named Pipes 通信
在为 CLI 应用程序使用 DB2 客户机之前,
必须将来自一个系统的 CLI 包与适当的绑定文件绑定在一起 | | Minimal 版 | Cloudscape, Version 10.1
Apache Derby, Version 10.1
Cloudscape, Version 10.0 Final Release
Apache Derby, Version 10.0
DB2 Family Servers | Linux
经测试的平台:
- Suse Linux Enterprise Edition 9
- Red Hat Enterprise Linux AS R3
| ODBC 支持
JDBC
DB2 CLP - Command Line Processor | 18.1 MB | 没有 Configuration Assistant - 没有 GUI,只有 Command Line Interface (CLI/ODBC) | | 完整版 | Cloudscape, Version 10.1
Apache Derby, Version 10.1
Cloudscape, Version 10.0 Final Release
Apache Derby, Version 10.0
DB2 Family Servers
DB2 Connect Servers | Windows
Windows 98
Windows Me
Windows NT
Windows 2000
Windows XP
Linux
Linux on Intel
Linux on S/390 和 zSeries
Unix
AIX (Versions 4.3 和 5)
HP-UX Version 11i
Solaris | 所有 Lite 中含有的功能再加上:
Control Center
Configuration Assistant
一些管理工具
一些客户机工具
LDAP Exploitation
MDAC 2.7
SQLJ 支持
一些通信协议
| Windows - 63.5 MB
Linux - 217 MB | N/A |

 |

|
DB2 Run-Time Client 的安装和下载说明
对于 DB2 Run-Time Client 的 Lite 和 Minimal 版,下面是它们的安装和下载说明。注意: 在 Linux 平台上使用 Cloudscape 与 ODBC 驱动程序是一种 beta 配置。要获得帮助、报告问题或询问问题,请访问 Cloudscape Developer Forum。
Linux 下载和配置
- 关于安装和下载 Linux 版 DB2 Run-Time Client Minimal, Version 8.2 的说明。
- 直到 Version 8.2,Linux 版的 DB2 Run-Time client 的完整版才包含针对 Cloudscape 的 ODBC 支持,该版本叫做 V810 FixPak 7。如果使用的是现有 DB2 安装,则该版本或更高版本的 Run-Time client 必须可用。
要确定安装了哪个版本和 FixPack,可发出 db2level 命令:
清单 1. 确定安装了哪个版本和 FixPack
linux db2inst1/sqllib> db2level
DB21085I Instance "db2inst1" uses "32" bits and DB2
code release "SQL08020"
with level identifier "03010106".
Informational tokens are "DB2 v8.1.0.72", "s040914",
"MI00086", and FixPak "7".
Product is installed at "/opt/IBM/db2/V8.1".
|
- 要在 Linux 上运行 ODBC 和 Cloudscape,需要 unixODBC,这可在 unixODBC Web 站点上得到。(参见 参考资料。)
与 unixODBC 相关的信息一般安装在 /etc/unixODBC 下面,库则在 /usr/lib/unixODBC 下面。下面是一个配置 TEST 数据源的例子。编辑 /etc/unixODBC/odbcinst.ini:
清单 2. 配置 TEST 数据源
[DB2]
Description = DB2 driver for Linux
Driver = /home/db2inst6/sqllib/lib/libdb2.so
FileUsage = 3
[ODBC]
Trace=yes
Tracefile=/home/db2inst6/odbcTrace.log
|
在 DB2 Client 实例的 HOME 目录下(一般是该目录下)创建一个 odbc.ini 文件,并添加到该文件:
[ODBC Data Source]
TEST=IBM DB2 ODBC DRIVER
[TEST]
Driver=/home/db2inst6/sqllib/lib/libdb2.so
|
更多信息请访问 DB2 Help 站点(参见 参考资料)。在 Windows 中编写的 ODBC 程序通常不能马上就在 Linux 中工作,在 Linux 上运行之前,需要做改变并重新编译。
- 要与 Cloudscape 数据库一起使用 ODBC 和 Linux,所有数据库名都必须是大写的。
- 要与 Cloudscape 数据库一起使用 ODBC 和 Linux,所有数据库名都必须在 derby.system.home 中。换句话说,当连接数据库时,不能使用路径来指定数据库位于哪里。数据库必须位于 derby.system.home 中。
Windows 下载
参考资料 学习
获得产品和技术
-
unixODBC:在 Linux 上运行 ODBC 和 Cloudscape 所必需的。
讨论
关于作者  | |  | Susan Cline 在 Cloudscape 工作,负责为 Cloudscape 开发人员和用户开发技术内容。 |
对本文的评价
|  |