JDBC Type 4 Driver 2.0 Programmer's Reference (SQL/MX 2.x)
minPoolSize❍
initialPoolSize❍
maxStatements❍
When used with the DriverManager class, the Type 4 driver has a connection-pool manager that determines which
connections are pooled together by a unique value for the following combination of properties:
url
catalog
schema
username
password
blobTableName
clobTableName
serverDataSource
Therefore, connections that have the same values for the combination of a set of properties are pooled together.
Note: The connection-pooling property values used at the first connection of a given combination are effective
throughout the life of the process. An application cannot change any of these property values after the first
connection for a given combination.
●
Statement Pooling
Guidelines for Statement Pooling
Troubleshooting Statement Pooling
The statement pooling feature allows applications to reuse the PreparedStatement object in same way that they can reuse
a connection in the connection pooling environment. Statement pooling is done completely transparent to the application.
Guidelines for Statement Pooling
To enable statement pooling, set the maxStatements property to an integer value greater than 0 and enable
connection pooling. See Connection Pooling for more information.
●
Enabling statement pooling for your JDBC applications might dramatically improve the performance.●
Explicitly close a prepared statement by using the Statement.close method because PreparedStatement
objects that are not in scope are also not reused unless the application explicitly closes them.
●
To ensure that your application reuses a PreparedStatement, call either of the following:
Statement.close method—called by the application
❍
Connection.close method—called by the application. All the PreparedStatement objects that were in
use are ready to be reused when the connection is reused.
❍
●
Troubleshooting Statement Pooling
Note the following Type 4 driver implementation details if you are troubleshooting statement pooling:
Type 4 driver looks for a matching PreparedStatement object in the statement pool and reuses the
PreparedStatement. The matching criteria include the SQL string, current catalog, current schema, current
transaction isolation, and resultSetHoldability. If the Type 4 driver finds the matching
PreparedStatement object, the driver returns the same PreparedStatement object to the application for reuse
and marks the PreparedStatement object as in use.
●










