DB2 Version 9.7 for Linux, UNIX, and Windows

Trusted_Connection CLI/ODBC configuration keyword

Specifies whether a connection made with the current authenticated user is allowed.

Syntax:
Trusted_Connection=Yes
Note: This keyword will have no effect if set in the db2cli.ini file. It should instead be provided in the connection string to SQLDriverConnect().
Default setting:
CLI uses the user ID and password information provided in the connection string to SQLDriverConnect(), not the current authenticated user.
Usage notes:
CLI applications that connect to a database will typically connect using the function SQLDriverConnect(). One of the input arguments for this function is the DriverCompletion value, which determines when a dialog will be opened. The following are the values of DriverCompletion :
  • SQL_DRIVER_PROMPT: A dialog is always initiated.
  • SQL_DRIVER_COMPLETE: A dialog is only initiated if there is insufficient information in the connection string.
  • SQL_DRIVER_COMPLETE_REQUIRED: A dialog is only initiated if there is insufficient information in the connection string. Only mandatory information is requested. The user is prompted for required information only.
  • SQL_DRIVER_NOPROMPT: The user is not prompted for any information. A connection is attempted with the information contained in the connection string. If there is not enough information, SQL_ERROR is returned.
Note: More details on DriverCompletion can be found in the documentation for SQLDriverConnect().

Some applications, for example, those in a Kerberos environment, might require that a user be able to connect to a DB2® server without providing a user ID or password. If the application uses the SQL_DRIVER_NO_PROMPT option on the SQLDriverConnect() call, the connection will be attempted without the user authentication. This keyword is then not required.

In the case where a third party application is involved and the prompt level used by the application is something other than SQL_DRIVER_NO_PROMPT, CLI will open a dialog to request the missing information from the user. Setting Trusted_Connection to Yes, by providing it to the input connection string for SQLDriverConnect() ("Trusted_Connection=Yes"), causes CLI to ignore any user ID or password string (including blank strings) from the connection string and ignore the prompt level of the connection function. CLI will use the current authenticated user to attempt the connection to the database. If the connection attempt fails, the user will be prompted for the user ID and password.

This keyword is used only in the connection string for SQLDriverConnect(); setting it in the db2cli.ini file will have no effect.