DB2 10.5 for Linux, UNIX, and Windows

db2cli.ini initialization file

The db2cli.ini file contains various keywords and values that you can use to configure the behavior of the CLI/ODBC driver and CLI/ODBC applications. The keywords can be associated with a specific database connection or all database connections by CLI and ODBC applications.

To help you get started, the db2cli.ini.sample sample configuration file is included with the IBM® data server products.

You can create a db2cli.ini file that is based on the db2cli.ini.sample file and place the db2cli.ini file in the same location as the db2cli.ini.sample file. The location of the sample configuration file depends on your IBM data server product and the operating system.

On Windows operating systems, there might also be a user-level db2cli.ini initialization file. Depending on the version of Windows operating system, the user-level db2cli.ini initialization file is stored in the \Documents and Settings\UserName or the \Users\UserName directory, where UserName represents the name of the logged in user. If there is a user-level db2cli.ini initialization file for the logged in user, the values in the user-level db2cli.ini initialization file take precedence over any other db2cli.ini initialization file. That is, if the same CLI configuration parameter is present in the user-level db2cli.ini initialization file as in any other db2cli.ini initialization file, it is the value in the user-leveldb2cli.ini initialization file that takes effect

For IBM Data Server Client, IBM Data Server Runtime Client, or IBM Data Server Driver Package, the sample configuration file is created in one of the following paths: The installation_path value represents the directory into which you installed the IBM data server product. For example, if you install the IBM Data Server Driver Package product on the Windows 7 operating system, and the data server driver copy name is IBMDBCL1, the db2cli.ini.sample file is created in the C:\ProgramData\IBM\DB2\IBMDBCL1\cfg directory.
For the IBM Data Server Driver for ODBC and CLI product installation, the sample configuration file is created in one of the following paths: The installation_path value represents the directory into which you extracted the IBM Data Server Driver for ODBC and CLI product. For example, if you install the IBM Data Server Driver for ODBC and CLI product on the Windows 7 operating system into the C:\IBMDB2\CLIDRIVER\ directory, the db2cli.ini.sample file is created in the C:\ProgramData\IBM\DB2\C_IBMDB2_CLIDRIVER\cfg directory.

You can use the DB2CLIINIPATH environment variable to specify a different location for the db2cli.ini file.

You can use the CLI/ODBC configuration keywords to perform the following tasks:

You can set most CLI/ODBC keywords in the db2cli.ini initialization file. However, you must set some keywords in the connection string for the SQLDriverConnect() function call.

The scope of the CLI/ODBC keywords is determined by the placement of the keywords within the db2cli.ini initialization file. If you specify the CLI keywords in a specific database section (data source section) within the db2cli.ini initialization file, the keywords are applicable only when your CLI/ODBC application is connected to that particular database. If the CLI keywords are listed in the [COMMON] section within the db2cli.ini initialization file, the keywords affect all CLI application connections to databases.

You can specify the following CLI keywords only in the [COMMON] section:

The [COMMON] section of the db2cli.ini file begins with the heading [COMMON].

Before you set a common keyword for a client, it is important to evaluate the effect of the keyword on all CLI/ODBC connections from that client. For example, the TRACE keyword generates information about all CLI/ODBC applications that connect to DB2® database servers on that client.

The database-specific section begins with the data source name (DSN) between square brackets:
[data_source_name]
The name that is enclosed between square brackets is called a section header.
You set a keyword to a value by using the following format:
KeywordName=keywordValue
The following other rules apply:
The following sample db2cli.ini file contains two database alias sections:
; This is a comment line.
[MYDB22]
AutoCommit=0
TableType="'TABLE','SYSTEM TABLE'"

; This is another comment line.
[MYDB2MVS]
CurrentSQLID=SAAID
TableType="'TABLE'"
SchemaList="'USER1',CURRENT SQLID,'USER2'"

Although you can edit the db2cli.ini file manually on all operating systems, you can also use the UPDATE CLI CONFIGURATION command if it is available. You must add a blank line after the last entry if you manually edit the db2cli.ini file.