DB2ConnectionPoolDataSource class
DB2ConnectionPoolDataSource is a factory for PooledConnection objects. An object that implements this interface is registered with a naming service that is based on the Java Naming and Directory Interface (JNDI).
DB2ConnectionPoolDataSource properties
These properties are defined only for the IBM® Data Server Driver for JDBC and SQLJ. "Properties for the IBM Data Server Driver for JDBC and SQLJ" for explanations of these properties.
void setProperty-name(data-type property-value)
A getXXX method
has this form: data-type getProperty-name()
Property-name is
the unqualified property name, with the first character capitalized.The following table lists the IBM Data Server Driver for JDBC and SQLJ properties and their data types.
Property name | Data type |
---|---|
com.ibm.db2.jcc.DB2ConnectionPoolDataSource.maxStatements | int |
DB2ConnectionPoolDataSource methods
- getDB2PooledConnection
- Formats:
public DB2PooledConnection getDB2PooledConnection(String user, String password, java.util.Properties properties) throws java.sql.SQLException public DB2PooledConnection getDB2PooledConnection( org.ietf.jgss.GSSCredential gssCredential, java.util.Properties properties) throws java.sql.SQLException
Establishes the initial untrusted connection in a heterogeneous pooling environment.
The first form getDB2PooledConnection provides a user ID and password. The second form of getDB2PooledConnection is for connections that use Kerberos security.
Parameter descriptions:- user
- The authorization ID that is used to establish the connection.
- password
- The password for the authorization ID that is used to establish the connection.
- gssCredential
- If the data source uses Kerberos security, specifies a delegated credential that is passed from another principal.
- properties
- Properties for the connection.
- getDB2TrustedPooledConnection
- Formats:
public Object[] getDB2TrustedPooledConnection(String user, String password, java.util.Properties properties) throws java.sql.SQLException public Object[] getDB2TrustedPooledConnection( java.util.Properties properties) throws java.sql.SQLException public Object[] getDB2TrustedPooledConnection( 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 trusted DB2PooledConnection instance.
- The second element is a unique cookie for the generated pooled connection instance.
Parameter descriptions:- user
- The data server authorization ID that is used to establish the trusted connection to the database server.
- password
- The password for the authorization ID that is used to establish the trusted connection.
- gssCredential
- If the data source uses Kerberos security, specifies a delegated credential that is passed from another principal.
- properties
- Properties for the connection.
- IBM Data Server Driver for JDBC and
SQLJ type 4 connectivity to: