The db2dsdriver.cfg configuration file contains database directory information and client configuration parameters in a human-readable format.
The db2dsdriver.cfg configuration file is an XML file that is based on the db2dsdriver.xsd schema definition file. The db2dsdriver.cfg configuration file contains various keywords and values that can be used to enable various features to a supported database through ODBC, CLI, .NET, OLE DB, PHP, Ruby, or embedded SQL applications. The keywords can be associated globally for all database connections, or they can be associated with a specific database source name (DSN) or database connection. You can also use this configuration file to enable high availability connection to supported databases.
The db2dsdriver.cfg file can be used with embedded SQL applications, ODBC, CLI, .NET, OLE DB, PHP, or Ruby drivers. You do not have to create and populate the db2dsdriver.cfg configuration file for these drivers. The applications can function without this configuration file. However, instead of specifying information about the database name, host, port, and configuration parameters in your applications, you can use the configuration file to define aliases.
Two subsections can be defined under the database information section to enable high availability features:
If you specify multiple entries of the same parameter, with different values, in the same section of a db2dsdriver.cfg file, you cannot determine which parameter value takes effect.
<configuration>
<dsncollection>
<dsn alias="alias1" name="name1" host="server1.net1.com" port="50001"/>
<!-- Long aliases are supported -->
<dsn alias="longaliasname2" name="name2" host="server2.net1.com" port="55551">
<parameter name="Authentication" value="Client"/>
</dsn>
</dsncollection>
<databases>
<database name="name1" host="server1.net1.com" port="50001">
<parameter name="CurrentSchema" value="OWNER1"/>
<wlb>
<parameter name="enableWLB" value="true"/>
<parameter name="maxTransports" value="50"/>
</wlb>
<acr>
<parameter name="enableACR" value="true"/>
</acr>
</database>
<!-- Local IPC connection -->
<database name="name3" host="localhost" port="0">
<parameter name="IPCInstance" value="DB2"/>
<parameter name="CommProtocol" value="IPC"/>
</database>
</databases>
<parameters>
<parameter name="GlobalParam" value="Value"/>
</parameters>
</configuration>
If you use a copy of the db2dsdriver.cfg file from Version 9.7 Fix Pack 2 or earlier on Windows, the file is in a different location. You must back up existing db2dsdriver.cfg file to a different path and copy it back to the new default configuration file path.
You can use the DB2DSDRIVER_CFG_PATH registry variable to specify a different location for the db2dsdriver.cfg file.
The db2dsdriver.cfg configuration file can be copied and edited manually. After editing the file, you must restart your ODBC, CLI, .NET, OLE DB, PHP, Ruby, or embedded SQL applications for the changes to take effect.
If you have an IBM Data Server Runtime Client or IBM Data Server Client, you can copy the existing database directory information into the db2dsdriver.cfg configuration file by using the db2dsdcfgfill command. When you run this command, the configuration file is populated based on the contents of the local database directory, node directory, and Database Connection Services (DCS) directory of a specific database manager instance.
If you have an IBM Data Server Driver for ODBC and CLI client, you can create the db2dsdriver.cfg.sample and db2cli.ini.sample sample configuration files by using the db2oreg1.exe utility or db2cli install -setup command.
IBM Data Server Client and IBM Data Server Runtime Client can catalog remote databases locally. In Version 9.7 Fix Pack 3 and later fix packs, you can define client parameters for the databases that are cataloged. IBM Data Server Client and IBM Data Server Runtime Client derive database, host, and port information from the database and node catalog directories and use that information to locate the corresponding entry in the db2dsdriver.cfg configuration file. Even if the DCS (database connection services) directory is cataloged using a different target database, the database name specified in the database directory is used to locate the corresponding entry in the db2dsdriver.cfg file.