Order of precedence for obtaining database information

Connection information can be obtained from different sources in specific order of precedence depending on the type of database client that you use.

The order of precedence is listed for the following scenarios:
For a CLI or open source application with an IBM® data server client:
  1. The connection string.
  2. Database, node, and DCS directories.
  3. The db2cli.ini file.
  4. The db2dsdriver.cfg file.
For a CLI or open source application with an IBM data server driver:
  1. The connection string.
  2. The db2cli.ini file.
  3. The db2dsdriver.cfg file.
For a .NET application with an IBM data server client
  1. The connection string or information that is provided through .NET object properties (DB2ConnectionStringBuilder properties).
  2. Database, node, and DCS directories.
  3. The db2dsdriver.cfg file.
For a .NET application with an IBM data server driver:
  1. The connection string or information that is provided through .NET object properties (DB2ConnectionStringBuilder properties).
  2. The db2dsdriver.cfg file.
For an embedded SQL application with an IBM data server client:
  1. The connection string.
  2. Database, node, and DCS directories.
  3. The db2dsdriver.cfg file.
For an embedded SQL application with an IBM data server driver:
  1. The connection string.
  2. The db2dsdriver.cfg file.
Note: Configuration parameters for client driver defined in user level db2cli.ini and db2dsdriver.cfg as well as system leveldb2cli.ini and db2dsdriver.cfg have the following priority (from high to low):
  1. User level db2cli.ini file
  2. System level db2cli.ini file
  3. User level db2dsdriver.cfg file
  4. System level db2dsdriver.cfg file
Note: If both user level and system level db2cli.ini file or db2dsdriver.cfg file is configured, then priority will be given to user level db2cli.ini file or user level db2dsdriver.cfg file.