Call Level Interface Guide and Reference
The DB2 Call Level Interface (CLI) run-time environment and the ODBC driver
are included with the DB2 Client Application Enabler. This is contained
on the DB2 Client Pack CD-ROM or can be downloaded from the Web page at
http://www.software.ibm.com/data/db2.
This support enables applications developed using ODBC and DB2 CLI APIs to
work with any DB2 server. DB2 CLI application development support is
provided by the DB2 Software Developer's Kit (DB2 SDK) which is part of
the separately orderable DB2 Application Development Kit product.
Before DB2 CLI or ODBC applications can access DB2, the DB2 CLI
packages must be bound on the server. Although this will occur
automatically on the first connection if the user has the required authority
to bind the packages, it is recommended that the administrator do this first
with each version of the client on each platform that will access the server.
See "How to Bind the DB2 CLI/ODBC Driver to the Database" for specific details.
The following general steps are required on the client system to give DB2
CLI and ODBC applications access to DB2 databases. These instructions assume
that you have successfully connected to DB2 using a valid user ID and
password. Depending on the platform many of these steps are automatic. For
complete details, see the section that deals specifically with your platform.
- Use the CCA to add the remote system (if you have separate client and
server machines) so that its instances and databases can be made known to the
Control Center, then add the instances and databases for that system. (Your
local system is represented by the icon labelled Local.) If you do
not have access to this program you can use the catalog command in
the command line processor.
- On all platforms other than OS/2 and Windows 3.1, the DB2 CLI/ODBC
driver is automatically installed when the DB2 Client Application Enabler is
installed, and therefore nothing needs to be done. On OS/2 and Windows
3.1 you must use the Install ODBC Driver icon to install both the
DB2 CLI/ODBC driver and the ODBC driver manager.
- To access the DB2 database from ODBC:
- The Microsoft, Visigenic, or other ODBC Driver Manager must already be
installed (this is done by default during the installation of DB2).
- The DB2 databases must be registered as ODBC data sources. The ODBC driver
manager does not read the DB2 catalog information; instead it references its
own list of data sources.
- If a DB2 table does not have a unique index then many ODBC applications
will open it as read-only. Create a unique index for each DB2 table that is to
be updated by an ODBC application. Refer to the CREATE INDEX
statement in the SQL Reference. Using the Control Center you would alter the settings of the table, then
click on the Primary Key tab and move one or more columns from the
available columns list over to the primary key columns list. Any column you
select as part of the primary key must be defined as NOT NULL.
- Various CLI/ODBC Configuration Keywords can be set to modify the behavior
of DB2 CLI/ODBC and the applications using it.
- If you followed the above steps to install ODBC support, and added DB2
databases as ODBC data sources, your ODBC applications will now be able to
access them.
After the platform specific instructions there are further details on the
following topics:
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
[ DB2 List of Books |
Search the DB2 Books ]