User Id And Password Security Under The Ibm Data Server Driver For Jdbc And Sqlj - IBM DB2 Manual

Table of Contents

Advertisement

The following table lists the security mechanisms that the IBM Data Server Driver
for JDBC and SQLJ supports, and the value that you need to specify for the
securityMechanism property to specify each security mechanism.
The default security mechanism is CLEAR_TEXT_PASSWORD_SECURITY. If the
server does not support CLEAR_TEXT_PASSWORD_SECURITY but supports
ENCRYPTED_USER_AND_PASSWORD_SECURITY, the IBM Data Server Driver
for JDBC and SQLJ driver updates the security mechanism to
ENCRYPTED_USER_AND_PASSWORD_SECURITY and attempts to connect to the
server. Any other mismatch in security mechanism support between the requester
and the server results in an error.
Table 98. Security mechanisms supported by the IBM Data Server Driver for JDBC and SQLJ
Security mechanism
User ID and password
User ID only
User ID and encrypted password
Encrypted user ID
Encrypted user ID and encrypted
password
Encrypted user ID and encrypted
security-sensitive data
Encrypted user ID, encrypted
password, and encrypted
security-sensitive data
Kerberos
Plugin
User ID and password security under the IBM Data Server Driver for
JDBC and SQLJ
With the IBM Data Server Driver for JDBC and SQLJ, one of the available security
methods is user ID and password security.
To specify user ID and password security for a JDBC connection, use one of the
following techniques.
For the DriverManager interface: You can specify the user ID and password directly
in the DriverManager.getConnection invocation. For example:
import java.sql.*;
...
String id = "dbadm";
String pw = "dbadm";
String url = "jdbc:db2://mvs1.sj.ibm.com:5021/san_jose";
Connection con = DriverManager.getConnection(url, id, pw);
Another method is to set the user ID and password directly in the URL string. For
example:
448
Application Programming Guide and Reference for Java
securityMechanism property value
DB2BaseDataSource.CLEAR_TEXT_PASSWORD_SECURITY
DB2BaseDataSource.USER_ONLY_SECURITY
DB2BaseDataSource.ENCRYPTED_PASSWORD_SECURITY
DB2BaseDataSource.ENCRYPTED_USER_ONLY_SECURITY
DB2BaseDataSource.ENCRYPTED_USER_AND_PASSWORD_SECURITY
DB2BaseDataSource.ENCRYPTED_USER_AND_DATA_SECURITY
DB2BaseDataSource.ENCRYPTED_USER_PASSWORD_AND_DATA_SECURITY
DB2BaseDataSource.KERBEROS_SECURITY
DB2BaseDataSource.PLUGIN_SECURITY
Related reference
"Properties for the IBM Data Server Driver for JDBC and SQLJ" on page 201
// JDBC base
// Set user ID
// Set password
// Set URL for the data source
// Create connection

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents