JDBC/MX 5.0 Driver for SQL/MX Programmer's Reference (SQL/MX 2.x)

Guidelines for Implementing an Application Server to Use Connection Pooling
The application server maintains a cache of the PooledConnection objects created by using
ConnectionPoolDataSource interface. When the client requests a connection object, the application looks for
the suitable PooledConnection object. The lookup criteria and other methods are specific to the application
server.
The application server implements the ConnectionEventListener interface and registers the listener object with
the PooledConnection object. The JDBC/MX driver notifies the listener object with a connectionClosed event
when the application is finished using the Connection object. Then, the connection pooling component can reuse
this PooledConnection object for future requests. The JDBC/MX driver also notifies the listener object with
connectionErrorOccurred event when the PooledConnection object fails to initialize the connection. The
application server's connection pooling component should discard the PooledConnection when such a
connection error event occurs.
The application server manages the connection pool by using the SQLMXConnectionPoolDataSource, which
implements the ConnectionPoolDataSource interface. Use the getter and setter methods, provided by
JDBC/MX, to set the connection pool configuration properties listed in the table of Standard
ConnectionPoolDataSource Object Properties. In addition to these standard properties, the
ConnectionPoolDataSource includes the JDBC/MX driver-specific properties as described under Connection
Using the DataSource Interface.
Standard ConnectionPoolDataSource Object Properties
Note: The application server defines the meaning of these properties.
Property Name Type Description
maxStatements int
The total number of PreparedStatement objects that the pool should
cache. This total includes both free objects and objects in use. 0 (zero)
disables statement pooling.
initialPoolSize int
The number of physical connections the pool should contain when it is
created.
minPoolSize int
The number of physical connections the pool should keep available at
all times. 0 (zero) indicates no maximum size.
maxPoolSize int
The maximum number of physical connections that the pool should
contain. 0 (zero) indicates no maximum size.
maxIdleTime int
The number of seconds that a physical connection should remain
unused in the pool before the connection is closed. 0 (zero) indicates
no limit.
propertyCycle int
The interval, in seconds, that the pool should wait before enforcing the
current policy defined by the values of the above connection pool
properties.
Connection Pooling Using the Basic DataSource API