JDBC Type 4 Driver Programmer's Reference for SQL/MX Release 3.2.1
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” (page 26)
“Troubleshooting Statement Pooling” (page 26)
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 PreparedStatement 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.
• The algorithm, "earlier used are the first to go," is used to make room for caching subsequently
generated PreparedStatement objects when the number of statements reaches the
maxStatements limit.
26 Accessing SQL Databases with SQL/MX