ODBC Data Source Administrator support for db2dsdriver.cfg file

In Windows, the ODBC Driver Manager is the link between an ODBC application and an ODBC driver. Applications require an ODBC access link with the driver manager and make ODBC API calls which cause the driver manager to load the appropriate ODBC Driver.

Attention: This feature is available in Db2® version 11.5.4 and later versions.

ODBC administrator is used to add DSN and then add, update, or delete CLI configuration parameters associated with it. The following are important points and scenarios.

  1. A New User DSN will be added in user level db2dsdriver.cfg file only when all three parameters, database name, host name, and port, are present in TCP⁄IP tab. Otherwise, parameters will be saved in the db2cli.ini file.
  2. While creating a new DSN, parameters entered in TCP⁄IP are given higher priority than other tabs such as Advanced Setting.
  3. When the user clicks Configure for a DSN, the DSN parameters from both the db2dsdriver.cfg file and db2cli.ini file will be shown. If the same parameter is present in both the db2dsdriver.cfg file and db2cli.ini file, then the parameters present in both files will be shown.
  4. When the user clicks Configure to identify where the parameter belongs to, the result can be found under the Type column after the Pending Value column.
  5. If a DSN is removed from the main ODBC Admin tab and the DSN exists in the db2dsdriver.cfg file, then the DSN with all parameters including special registers and session global variables related to DSN will be removed from the db2dsdriver.cfg file. If there is a database section corresponding to the Host, Port, or Database parameters in the db2dsdriver.cfg file, then it will not be removed.
  6. The user can add the same DSN name to an existing DSN by entering text into the “Data source name” text box and clicking ADD. The parameters from db2cli.ini and db2dsdriver.cfg will be loaded for the DSN in the advanced settings dialog box and database name. Host name/port number from db2dsdriver.cfg will be added in the TCP⁄IP options tab and will work like the Modify and Configure buttons.
  7. While creating a new DSN host, Port and Database information need to be entered in the TCP⁄IP tab. The other parameters related to DSN can be added in the advanced tab.
  8. If there are duplicates in advanced setting while reading DSN from db2dsdriver.cfg or db2cli.ini, then duplicate parameters will be removed and only unique parameters will be saved in the db2dsdriver.cfg file.
  9. Under the “Advanced Settings” tab, if any of the Host, Port, or Database parameters are removed for an existing DSN entry in the db2dsdriver.cfg file, then these parameters will not be updated in the db2dsdriver.cfg file.
  10. The Special register section, Session global variables, WLB/ACR section, Global parameter, and LDAP section present in the db2dsdriver.cfg file will be ignored while loading and writing parameters for a DSN.
  11. For a valid DSN which has Host, Port, and database information in the db2cli.ini file, if the user clicks Configure then all the parameters will be displayed under the “Advanced Settings” tab. If the user clicks OK, the DSN in the db2cli.ini file with all its parameters, which are supported in cfg, will be migrated and saved to the db2dsdriver.cfg file. The parameters for the DSN which are supported only in the db2cli.ini file will continue to be saved in the db2cli.ini file.
  12. When the user clicks Configure or Add, adds or updates/edits parameters, and clicks OK, then the db2dsdriver.cfg file is created (if not present earlier) or gets updated. An error may occur during the following scenarios when the db2dsdriver.cfg file is created or updated.
    • The db2dsdriver.cfg file is in read-only mode.
    • The db2dsdriver.xsd schema file cannot be accessed.
    • The db2dsdriver.xsd schema file cannot be located.
    • The schema validation failed because the configuration file named db2dsdriver.cfg is not valid.
  13. The order of precedence of CLI driver parameters is as follows:
    1. OCM pushdown properties
    2. Dialog properties
    3. Connection string
    4. Database catalog
    5. User level db2cli.ini file
    6. System level db2cli.ini file
    7. User level db2dsdriver.cfg file
    8. System level db2dsdriver.cfg file
    9. Connection attributes
    10. Environment attributes
  14. The following parameters are not supported in the db2dsdriver.cfg file as a parameter name. If the user selects these parameters in the ODBC Data Source Administrator, then these parameters will be saved in the db2cli.ini file only.
    • DB2NETNamedParam
    • DBAlias
    • SaveFile
    • FileDSN
    • DiagPath
    • CheckForFork
    • DisableMultiThread
    • NotifyLevel
    • PWDPlugin
    • SkipTrace
    • ReadCommonSectionOnNullConnect
    • Trace
    • TraceAPIList
    • TraceAPIList!
    • TraceComm
    • TraceErrImmediate
    • TraceFileName
    • TraceFlush
    • TraceFlushOnError
    • TraceLocks
    • TracePathName
    • TracePIDList
    • TracePIDTID
    • TraceRefreshInterval
    • TraceStmtOnly
    • TraceTime
    • TraceTimestamp

For a list of supported data server driver configuration keywords, please see IBM® data server driver supported db2cli.ini configuration keywords.