IBM Books

Call Level Interface Guide and Reference

Detailed Configuration Information

The section "Platform Specific Details for CLI/ODBC Access" should provide you with all of the information you require. The following additional information is useful where DB2 tool support is not available, and for administrators who require more detailed information.

How to Bind the DB2 CLI/ODBC Driver to the Database

The CLI/ODBC driver will autobind on the first connection to the database, provided the user has the appropriate privilege or authorization. The administrator may want to perform the first connect or explicitly bind the required files.

Table 11. DB2 CLI Bind Files and Package Names
Bind File Name Package Name Needed by DB2 Universal Database Needed by DRDA servers
db2clics.bnd SQLL15xx Yes Yes
db2clirr.bnd SQLL25xx Yes Yes
db2cliur.bnd SQLL35xx Yes Yes
db2clirs.bnd SQLL45xx Yes Yes
db2clinc.bnd SQLL55xx No DB2 for AS/400
db2cliws.bnd SQLL65xx Yes No
db2clims.bnd SQLL75xx No DB2 for MVS/ESA
db2clivm.bnd SQLL85xx No SQL/DS
db2cliv1.bnd SQLLB5xx Version 1 only No
db2cliv2.bnd SQLL95xx Version 2 or later No
db2clias.bnd SQLLA5xx No DB2 for AS/400
Note:Where the 'xx' is unique for each platform, such as:
C0
DB2 for AIX
D0
DB2 for OS/2
W0
DB2 Client Application Enabler for Windows

Previous versions of DB2 servers do not need all of the bind files and will therefore return errors at bind time.

The db2cli.lst file contains the names of the required bind files for DB2 CLI to connect to DB2 Version 2 or later servers (db2clixx.bnd where xx is cs, rr, rs, ur, ws, and v2). The db2cli1.lst file contains the names of the required bind files for DB2 CLI to connect to DB2 Version 1 servers (db2clixx.bnd where xx is cs, rr, ur, and v1).

For DRDA servers:

How to Set CLI/ODBC Configuration Keywords

DB2 CLI can be configured further by using either the CCA or the DB2 Client Setup administration tool, whichever is applicable for your platform, or by manually editing the db2cli.ini file.

This file contains various keywords and values that can be used to modify the behavior of DB2 CLI and the applications using it. The keywords are associated with the database alias name, and affect all DB2 CLI and ODBC applications that access the database.

By default, the location of the CLI/ODBC configuration keyword file is as follows:

Platform:
Location:

OS/2
sqllib directory

Windows NT
sqllib directory

Windows 95
sqllib directory

Windows 3.1
sqllib\win directory

UNIX
sqllib/cfg directory of the database instance running the CLI/ODBC applications

The environment variable DB2CLIINIPATH can also be used to override the default and specify a different location for the file.

The configuration keywords enable you to:

For a complete description of all the keywords and their usage, refer to "Configuration Keywords".

Configuring db2cli.ini

The db2cli.ini initialization file is an ASCII file which stores values for the DB2 CLI configuration options. A sample file is shipped to help you get started. Refer to "Configuration Keywords" for information on each keyword.

See "Platform Specific Details for CLI/ODBC Access" for more information on how to modify this file on your platform.

Within the file, there is one section for each database (data source) the user wishes to configure, as well as a common section (if necessary) that affects all connections to DB2.

Only the keywords that apply to all connections to DB2 through the DB2 CLI/ODBC driver are included in the COMMON section. This includes the following keywords:

All other keywords are to be placed in the database specific section, described below.

The COMMON section of the db2cli.ini file begins with:

[COMMON]

Before setting a common keyword it is important to evaluate its impact on all DB2 CLI/ODBC connections from that client. A keyword such as TRACE, for instance, will generate information on all DB2 CLI/ODBC applications connecting to DB2 on that client, even if you are intending to trouble shoot only one of those applications.

Each database specific section always begins with the name of the database alias between square brackets:

[database alias]
This is called the section header.

The parameters are set by specifying a keyword with its associated keyword value in the form:

KeywordName =keywordValue

The following is a sample .INI file with 2 database alias sections:

; This is a comment line.
[MYDB22]
AUTOCOMMIT=0
TABLETYPE="'TABLE','SYSTEM TABLE'"
 
; This is another comment line.
[MYDB2MVS]
DBNAME=SAAID
TABLETYPE="'TABLE'"
SCHEMALIST="'USER1',CURRENT SQLID,'USER2'"

Although you can edit the db2cli.ini file manually on all platforms, we recommend that you use the CCA if it is available on your platform.

How to Configure ODBC.INI

Microsoft's 16-bit ODBC Driver Manager and Visigenic's ODBC Driver Manager use the odbc.ini file to record information about the available drivers and data sources. Visigenic's ODBC Driver Manager also uses the odbcinst.ini file on UNIX platforms. Although the necessary files are updated automatically by the tools on most platforms, users of ODBC on UNIX platforms will have to edit them manually. The file odbc.ini (and odbcinst.ini where required) are located:

Platform:
Location:

Windows
drive:\windows (where drive is the drive where Windows is installed)

Win-OS/2
drive:\os2\mdos\winos2 (where drive is the drive where OS/2 is installed)

UNIX
Home directory of user ID running ODBC application

It is also possible to modify this file manually. Do not change any of the existing entries in the file.

  1. Use an ASCII editor to edit the odbc.ini file.

    The following is an example odbc.ini file:

         [ODBC Data Sources]
         MS Access Databases=Access Data (*.mdb)
     
         [MS Access Databases]
         Driver=D:\WINDOWS\SYSTEM\simba.dll
         FileType=RedISAM
         SingleUser=False
         UseSystemDB=False
    

    The [ODBC Data Sources] section lists the name of each available data source and the description of the associated driver.

    For each data source listed in the [ODBC Data Sources] section, there is a section that lists additional information about that data source. These are called the Data Source Specification sections.

  2. Under the [ODBC DATA SOURCE] entry, add the following line:
    database_alias=IBM DB2 ODBC DRIVER
    
    where database_alias is the alias of the database cataloged in the database directory (the database name used by the command line processor CONNECT TO statement).

  3. Add a new entry in the Data Source Specification section to associate the data source with the driver:
    [database_alias]
    Driver=drive:\windows\system\db2cliw.dll
    
    Where:

The following shows the example file with the IBM data source entries added:

     [ODBC Data Sources]
     MS Access Databases=Access Data (*.mdb)
     SAMPLE=IBM DB2 ODBC DRIVER
 
     [MS Access Databases]
     Driver=D:\WINDOWS\SYSTEM\simba.dll
     FileType=RedISAM
     SingleUser=False
     UseSystemDB=False
 
     [SAMPLE]
     Driver=D:\WINDOWS\SYSTEM\db2cliw.dll
     Description=Sample DB2 Client/Server database
Note:If you are running the ODBC application under WIN-OS/2, specify the equivalent path \OS2\MDOS\WINOS2\SYSTEM in place of the \WINDOWS\SYSTEM path.

UNIX Configuration of .ini files

The section "UNIX Client Access to DB2 using CLI/ODBC" contains detailed steps on how to update both the odbc.ini and odbcinst.ini files.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]