DB2XADataSource class
DB2XADataSource is a factory for XADataSource objects. An object that implements this interface is registered with a naming service that is based on the Java™ Naming and Directory Interface (JNDI).
The com.ibm.db2.jcc.DB2XADataSource class extends the com.ibm.db2.jcc.DB2BaseDataSource class, and implements the javax.sql.XADataSource, java.io.Serializable, and javax.naming.Referenceable interfaces.
DB2XADataSource methods
- getDB2TrustedXAConnection
- Formats:
public Object[] getDB2TrustedXAConnection(String user, String password, java.util.Properties properties) throws java.sql.SQLException public Object[] getDB2TrustedXAConnection( java.util.Properties properties) throws java.sql.SQLException public Object[] getDB2TrustedXAConnection( org.ietf.jgss.GSSCredential gssCredential, java.util.Properties properties) throws java.sql.SQLException
An application server using a system authorization ID uses this method to establish a trusted connection.
Trusted connections are supported for:- IBM® Data Server Driver for JDBC and
SQLJ type 4 connectivity to:
- Db2® on Linux®, UNIX, and Windows systems Version 9.5 or later
- Db2 for z/OS® Version 9.1 or later
- IBM Informix® Version 11.70 or later
- IBM Data Server Driver for JDBC and SQLJ type 2 connectivity on Db2 for z/OS Version 9.1 or later
The following elements are returned in Object[]:- The first element is a DB2TrustedXAConnection instance.
- The second element is a unique cookie for the generated XA connection instance.
Parameter descriptions:- user
- The authorization ID that is used to establish the trusted connection. For a connection that uses token authentication, the user value must be null.
- password
- The password for the authorization ID that is used to establish the trusted connection. For a connection that uses token authentication, the password value must be null.
- gssCredential
- If the data source uses Kerberos security, specifies a delegated credential that is passed from another principal.
- properties
- Properties for the connection. For a connection that uses token authentication, the accessToken and accessTokenType property values can be provided through the properties parameter.
- IBM® Data Server Driver for JDBC and
SQLJ type 4 connectivity to:
- getDB2TrustedPooledConnection
- Format:
public Object[] getDB2TrustedPooledConnection(java.util.Properties properties) throws java.sql.SQLException
An application server using a system authorization ID uses this method to establish a trusted connection, using the user ID and password for the DB2XADataSource object.
Trusted connections are supported for:- IBM Data Server Driver for JDBC and
SQLJ type 4 connectivity to:
- Db2 on Linux, UNIX, and Windows systems Version 9.5 or later
- Db2 for z/OS Version 9.1 or later
- IBM Informix Version 11.70 or later
- IBM Data Server Driver for JDBC and SQLJ type 2 connectivity on Db2 for z/OS Version 9.1 or later
The following elements are returned in Object[]:- The first element is a trusted DB2TrustedPooledConnection instance.
- The second element is a unique cookie for the generated pooled connection instance.
Parameter descriptions:- properties
- Properties for the connection.
- IBM Data Server Driver for JDBC and
SQLJ type 4 connectivity to:
- getDB2XAConnection
- Formats:
public DB2XAConnection getDB2XAConnection(String user, String password, java.util.Properties properties) throws java.sql.SQLException public DB2XAConnection getDB2XAConnection( org.ietf.jgss.GSSCredential gssCredential, java.util.Properties properties) throws java.sql.SQLException
Establishes the initial untrusted connection in a heterogeneous pooling environment.
The second form of getDB2XAConnection is for connections that use Kerberos security.
Parameter descriptions:- user
- The authorization ID that is used to establish the connection. For a connection that uses token authentication, the user value must be null.
- password
- The password for the authorization ID that is used to establish the connection. For a connection that uses token authentication, the password value must be null.
- gssCredential
- If the data source uses Kerberos security, specifies a delegated credential that is passed from another principal.
- properties
- Properties for the connection. For a connection that uses token authentication, the accessToken and accessTokenType property values can be provided through the properties parameter.