EasyManuals Logo

IBM DB2 User Manual

IBM DB2
585 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #464 background imageLoading...
Page #464 background image
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 securityMechanism property value
User ID and password DB2BaseDataSource.CLEAR_TEXT_PASSWORD_SECURITY
User ID only DB2BaseDataSource.USER_ONLY_SECURITY
User ID and encrypted password DB2BaseDataSource.ENCRYPTED_PASSWORD_SECURITY
Encrypted user ID DB2BaseDataSource.ENCRYPTED_USER_ONLY_SECURITY
Encrypted user ID and encrypted
password
DB2BaseDataSource.ENCRYPTED_USER_AND_PASSWORD_SECURITY
Encrypted user ID and encrypted
security-sensitive data
DB2BaseDataSource.ENCRYPTED_USER_AND_DATA_SECURITY
Encrypted user ID, encrypted
password, and encrypted
security-sensitive data
DB2BaseDataSource.ENCRYPTED_USER_PASSWORD_AND_DATA_SECURITY
Kerberos DB2BaseDataSource.KERBEROS_SECURITY
Plugin DB2BaseDataSource.PLUGIN_SECURITY
Related reference
“Properties for the IBM Data Server Driver for JDBC and SQLJ” on page 201
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.*; // JDBC base
...
String id = "dbadm"; // Set user ID
String pw = "dbadm"; // Set password
String url = "jdbc:db2://mvs1.sj.ibm.com:5021/san_jose";
// Set URL for the data source
Connection con = DriverManager.getConnection(url, id, pw);
// Create connection
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

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM DB2 and is the answer not in the manual?

IBM DB2 Specifications

General IconGeneral
DeveloperIBM
Initial Release1983
LicenseProprietary
Written inC, C++
CategoryDatabase Management System (RDBMS)
Operating SystemLinux, Windows
Programming LanguagesC, C++
Data ModelsRelational
EditionsCommunity, Standard, Advanced
Key Featureshigh availability, scalability