JDBC Driver for SQL/MP 3.0

Determining of the Pool is Large Enough
Using an SQLMPDataSource with an SQLMPConnectionPoolDataSource
Basic DataSource Object Properties
The basic DataSource class includes a set of properties that control connection pooling.
To set the property values for your application, you use the SQLMPDataSource class, which provides getter and setter
methods. The properties, listed below, are described under JDBC/MP Connection-Pooling and Statement-Pooling
Properties.
maxStatements
maxPoolSize
minPoolSize
poolLogging
TransactionMode
jdbcPropfile
Note: The properties defined for the SQLMPDataSource class and the SQLMPConnectionPoolDataSource
class are similar but the default values are slightly different.
Requesting Connection and Statement Pooling
Before deploying an SQLMPDataSource, set the properties that request both connection and statement pooling. This
code example shows these properties being set:
SQLMPDataSource ds = new SQLMPDataSource();
ds.setMaxPoolSize(0);
ds.setMaxStatements(100);
The values that you use when setting these properties depend on your application. Notice that the minPoolSize
property was not set. Because creating a connection is not an expensive operation for the JDBC/MP driver, only the
maxPoolSize property needs to be set.
Determining if the Pool is Large Enough
If the values specified for the connection pool are not large enough for a specific application, the JDBC/MP driver
throws an SQLException when a user application tries to obtain a connection and the pool is full. If this error occurs,
consider setting maxPoolSize to zero (0) to make the size of the connection pool unlimited.
If the values specified for the prepared statement pool are not large enough for a specific application, the JDBC/MP
driver still returns a PreparedStatement. In this case, the JDBC/MP driver might not pool all the prepared statements
used by the application when the application in a steady state.
To determine if the pool is large enough for an application, SQLMPDataSource provides the standard methods
setLogWriter and getLogWriter, which you can use with the setPoolLogging method (which is not according to the
JDBC 3.0 standard). To get the status of the connection pool or statement pool, deploy the SQLMPDataSource with
setPoolLogging set to true. An application uses the setLogWriter method to provide an output writer and runs the
application normally. The statement pool then writes information about the pool to the output writer. For example:
// When deploying the data source
SQLMPDataSource sds = new SQLMPDataSource();