JDBC Type 2 Driver 3.0 Programmer's Reference (SQL/MX 3.x)

Connection Pooling Using the Basic DataSource API
For your JDBC application to enable connection pooling, use the basic DataSource interface, which includes
the following properties that control connection pooling:
maxPoolSize
minPoolSize
maxStatements
Your application can enable connection pooling in the following two ways:
By setting the dataSourceName property in the basic DataSource object to the previously registered
ConnectionPoolDataSource object. When the connection pooling is enabled, the JDBC/MX driver-
specific properties in the
ConnectionPoolDataSource object are effective, and the JDBC/MX driver-
specific properties in the
DataSource object are ignored. The connection is initialized with the JDBC/MX
driver-specific properties when the
PooledConnection is obtained.
By using the properties in the DataSource object, when the dataSourceName property is empty.
Connection pooling is disabled by default. Note that the default value for the
maxPoolSize property is -
1, which disables connection pooling. See the
DataSource interface for the details on using these
properties.
For troubleshooting application connection pooling, note the following details on how the feature is
implemented. JDBC/MX looks for the first available
PooledConnection object and assigns the object to the
client requests for a connection. JDBC/MX ensures that the SQL/MX execution environment and compilation
environment remain the same for all the connections in the connection pooling environment; that is, the
environment is the same as when the initial connection was obtained by the client session either from the
pool or from a new physical connection.
Connection Pooling with the DriverManager Class
Connection pooling is available by default when your JDBC application uses the DriverManager class for
connections. You can manage connection pooling by using the following properties listed in the
DriverManager Object Properties table and described as under JDBC/MX Properties:
maxPoolSize
minPoolSize
maxStatements
Set these properties in either of two ways:
Using the option -Dproperty_name=property_value in the command line
Using the java.util.Properties parameter in the getConnection() method of the DriverManager class
Use these guidelines when setting properties for connection pooling with the
DriverManager class:
To enable connection pooling, set the maxPoolSize property to an integer value greater than 0 (zero).
The properties passed through the Properties parameter have a higher precedence over the
command-line properties.
Connections with the same catalog-schema combination are pooled together and managed by the
JDBC/MX driver. The connection-pooling property values that the application process uses when it
obtains the first connection for a given catalog-schema combination are effective for that combination
through the life of the application process.