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.
In Version 9.7 Fix Pack 3 and later, 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 db2cli.ini.sample file
location is the default location from which the db2cli.ini file
is read. The location of the sample configuration file depends on
your IBM data server product
and the operating system.
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:
- On AIX®, HP-UX, Linux, or Solaris operating systems: the installation_path/cfg directory
- On Windows XP and Windows Server 2003 operating
systems: the C:\Documents and Settings\All Users\Application
Data\IBM\DB2\driver_copy_name\cfg directory
- On Windows Vista, Windows 7, and Windows Server 2008 operating systems: the C:\ProgramData\IBM\DB2\driver_copy_name\cfg directory
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 XP operating system,
and the data server driver copy name is DSD_COPY, the
db2cli.ini.sample file
is created in the
C:\Documents and Settings\All Users\Application
Data\IBM\DB2\DSD_COPY\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:
- On AIX, HP-UX, Linux, or Solaris operating systems: the installation_path/cfg directory
- On Windows XP and Windows Server 2003 operating
systems: the C:\Documents and Settings\All Users\Application
Data\IBM\DB2\installation_path\cfg directory
when you run the db2cli install -setup command
with administrator authority
- On Windows Vista, Windows 7, and Windows Server 2008 operating systems: the C:\ProgramData\IBM\DB2\installation_path\cfg directory
when you run the db2cli install -setup command
with administrator authority
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 Vista 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.
When the ODBC Driver Manager is used to configure a user DSN on Windows operating systems, the db2cli.ini file
is created in Documents and Settings\User Name where User
Name represents the name of the user directory.
You can use the DB2CLIINIPATH environment
variable to specify a different location for the db2cli.ini file.
If you use a copy of the db2cli.ini file from
Version 9.7 Fix Pack 2 or earlier on Windows,
the file is in a different location. You can keep the copy of the db2cli.ini file
in the previous location, but this location might not be valid in
future releases.
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:
- CheckForFork
- DiagPath
- DisableMultiThread
- JDBCTrace
- JDBCTraceFlush
- JDBCTracePathName
- QueryTimeoutInterval
- ReadCommonSectionOnNullConnect
- Trace
- TraceComm
- TraceErrImmediate
- TraceFileName
- TraceFlush
- TraceFlushOnError
- TraceLocks
- TracePathName
- TracePIDList
- TracePIDTID
- TraceRefreshInterval
- TraceStmtOnly
- TraceTime
- TraceTimeStamp
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:
- All the keywords and their associated values for a particular
database must be located under the database section header.
- If the database-specific section does not contain a DBAlias keyword,
the data source name is used as the database alias when the connection
is established.
- The keywords are not case-sensitive; however, their values can
be.
- If a database is not found in the db2cli.ini file,
the default values for the keywords apply.
- You introduce comments by putting a semicolon in the first position
of a new line.
- Blank lines are allowed.
- If duplicate entries for a keyword exist, the first entry is used,
and no warning is given.
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.