JDBC Type 4 Driver Programmer's Reference
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 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:
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 maxStatements 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 username, password, catalog, schema, and server data source combination are pooled together and
managed by the Type 4 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.
●
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. Using statement
pooling is described in the following topics:
Guidelines for Statement Pooling●
Controlling the Performance of ResultSet Processing●
Troubleshooting Statement Pooling●
Guidelines for Statement Pooling
Enable statement pooling by setting the DataSource object maxStatements property to an integer value greater than 0 and,
also, by enabling 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.
❍
●