Application Programming Interface Guide > Built-in Procedures > Procedures Reference > SetDataSourceCredentials
 
SetDataSourceCredentials
Set a username and password to use with pass-through authentication and a specific data source.
This procedure provides access to the facility described in the “Multiple Credentials for JDBC Connection” section of the TDV User Guide.
This procedure can be used in place of the JDBC facility when the incoming connection is received from a source other than JDBC (for example, Web Service or ODBC), or when the JDBC client cannot be modified.
The JDBC facility allows a NULL value to be specified for dbPath. This built-in procedure does not support a NULL dbPath, but an empty string for dbPath can be used to access the same behavior.
If the client does any sort of connection pooling or connection reuse, a subsequent user may have access to data accessible from these credentials. Always discard the connection or call either the clearAllDataSourceCredentials JDBC method or ClearAllDataSourceCredentials before returning the connection to a connection pool.
Location
/lib/util/
Inputs
dbPath: The path identifying the data source to which these credentials pertain. If an empty string is provided, it is used as the default pass-through authentication credential.
username: The username to use when attempting to connect to a pass-through authentication data source.
password: The password to use when attempting to connect to a pass-through authentication data source.
Outputs
N/A
Exceptions
IllegalArgumentException: If any variable is set to an illegal value.