Troubleshooting
Problem
This document describes the use of the cwbmptrc utility to override the connection string for connections made with the IBM® DB2® UDB for iSeries .NET Provider.
Resolving The Problem
The iSeries Access for Windows .Net Data Provider (IBM.Data.DB2.iSeries) includes a utility that allows the connect string used by an application to be overridden. This can be useful during testing or to enable certain diagnostics, such as server side traces.
Syntax:
cwbmptrc -override "connection-string-override values"
Examples:
Example 1 overrides the system used for the connection and the connection timeout value:
Example 2 starts several server side diagnostics:
Example 3 deletes all overrides:
Example 4 will display the current override setting, if it is set:
Implementation Notes:
Overrides are stored in the registry key:
HKLM\Software\IBM\Client Access\CurrentVersion\Common\ManagedProvider\Service\Connection String Override.
Caution: The override is persistent (it persists across reboots) and is global (affects all applications on the PC). |
Syntax:
cwbmptrc -override "connection-string-override values"
"connection-string-override values" - A list of zero or more valid connection string settings in the format keyword=value;. An empty string ("") clears the override. The -v option displays the current override value if one is set. |
Examples:
Example 1 overrides the system used for the connection and the connection timeout value:
cwbmptrc -override "DataSource=lp126ab; ConnectionTimeout=12;"
Example 2 starts several server side diagnostics:
cwbmptrc -override "Trace=PrintJoblog, StartDebug;QueryOptionsFileLibrary=MYLIB;"
Example 3 deletes all overrides:
cwbmptrc -override ""
Example 4 will display the current override setting, if it is set:
cwbmptrc -v
Implementation Notes:
Overrides are stored in the registry key:
HKLM\Software\IBM\Client Access\CurrentVersion\Common\ManagedProvider\Service\Connection String Override.
Users of the utility must have write authority to that section of the registry. When iDB2Connection.Open() is called, the provider checks for an override stored in the registry. The override string is appended to the existing connection string. The provider then parses the connection string left to right. If duplicate keywords exist in the string, the last value processed is the one used. Because the override is appended to the string, it will always be the value that is used.
The syntax and validity of the override string is not checked until the connection.Open() method is called. If an invalid string is specified in the override, it will not be caught until the application actually calls Open().
As an example, consider the override specified in Example 1 above. If the application specifies a connection.ConnectionString of "DataSource=lp116ab," the override setting will cause datasource lp126ab to be used. The override will also cause a new option, ConnectionTimeout=12, to be added. The data source specified on the application connection string is replaced with the value in the override.
The cwbmp trace will log any overrides. The following is an example of the trace output:
Application ConnectionString is "DataSource=lp126ab".
cwbmptrc -override "DataSource=MyNewDataSource".
<timestamp and pid/tid information removed for better readability>
The syntax and validity of the override string is not checked until the connection.Open() method is called. If an invalid string is specified in the override, it will not be caught until the application actually calls Open().
As an example, consider the override specified in Example 1 above. If the application specifies a connection.ConnectionString of "DataSource=lp116ab," the override setting will cause datasource lp126ab to be used. The override will also cause a new option, ConnectionTimeout=12, to be added. The data source specified on the application connection string is replaced with the value in the override.
The cwbmp trace will log any overrides. The following is an example of the trace output:
Application ConnectionString is "DataSource=lp126ab".
cwbmptrc -override "DataSource=MyNewDataSource".
<timestamp and pid/tid information removed for better readability>
iDB2Connection(7).Void Open() : entry iDB2Connection(7).Void Open() : Using ConnectionStringOverride: DataSource=MyNewDataSource iDB2Connection(7).Void ParseConnectionString(System.String ByRef) : entry iDB2Connection(7).Void ParseConnectionString(System.String ByRef) : Setting DataSource property to: lp126ab iDB2Connection(7).Void ParseConnectionString(System.String ByRef) : Setting DataSource property to: MyNewDataSource iDB2Connection(7).Void ParseConnectionString(System.String ByRef) : complete: iDB2Connection(7).Void ParseConnectionString(System.String ByRef) : exit |
[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z000000cx3rAAA","label":"Data Access-\u003EADO.NET"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]
Historical Number
330700053
Was this topic helpful?
Document Information
More support for:
IBM i
Component:
Data Access->ADO.NET
Software version:
All Versions
Operating system(s):
IBM i
Document number:
639307
Modified date:
02 May 2025
UID
nas8N1016202
Manage My Notification Subscriptions