Ibm Data Server Driver For Jdbc And Sqlj Trusted Context Support - IBM DB2 Manual

Table of Contents

Advertisement

properties.put("securityMechanism",
String url = "jdbc:db2://mvs1.sj.ibm.com:5021/san_jose";
Connection con = DriverManager.getConnection(url, properties);
For the DataSource interface: If you create and deploy the DataSource object, set
the Kerberos server, delegated credential, and security mechanism by invoking the
DataSource.setKerberosServerPrincipal, DataSource.setGssCredential, and
DataSource.setSecurityMechanism methods after you create the DataSource object.
For example:
DB2SimpleDataSource db2ds = new com.ibm.db2.jcc.DB2SimpleDataSource();
db2ds.setDriverType(4);
db2ds.setDatabaseName("san_jose");
db2ds.setServerName("mvs1.sj.ibm.com"); // Set the server name
db2ds.setPortNumber(5021);
db2ds.setKerberosServerPrincipal(
db2ds.setGssCredential(delegatedCredential);
db2ds.setSecurityMechanism(

IBM Data Server Driver for JDBC and SQLJ trusted context support

The IBM Data Server Driver for JDBC and SQLJ provides methods that allow you
to establish and use trusted connections in Java programs.
Trusted connections are supported for:
v
v
A three-tiered application model consists of a database server, a middleware server
such as WebSphere Application Server, and end users. With this model, the
middleware server is responsible for accessing the database server on behalf of end
users. Trusted context support ensures that an end user's database identity and
database privileges are used when the middleware server performs any database
requests on behalf of that end user.
456
Application Programming Guide and Reference for Java
new String("" +
com.ibm.db2.jcc.DB2BaseDataSource.KERBEROS_SECURITY + ""));
"sample/srvlsj.ibm.com@SRVLSJ.SJ.IBM.COM");
com.ibm.db2.jcc.DB2BaseDataSource.KERBEROS_SECURITY);
Related tasks
"Connecting to a data source using the DataSource interface" on page 15
"Connecting to a data source using the DriverManager interface with the IBM
Data Server Driver for JDBC and SQLJ" on page 11
"Creating and deploying DataSource objects" on page 19
Related reference
"Properties for the IBM Data Server Driver for JDBC and SQLJ" on page 201
IBM Data Server Driver for JDBC and SQLJ type 4 connectivity to DB2
Database for Linux, UNIX, and Windows Version 9.5 or later, and DB2 for z/OS
Version 9.1 or later
IBM Data Server Driver for JDBC and SQLJ type 2 connectivity to DB2 for z/OS
Version 9.1 or later
// Set the delegated credential
// Set security mechanism to
// Kerberos
// Set URL for the data source
// Create the connection
// Create the DataSource object
// Set the driver type
// Set the location
// Set the port number
// Set the Kerberos server
// Set the delegated credential
// Set security mechanism to
// Kerberos

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents