JDBC Driver for SQL/MP 3.0
application. If the pool does not find a proper object, the JDBC/MP driver creates a new
PreparedStatement
object. An application can assure that a PreparedStatement object is returned to the free pool by calling either
of these:
PreparedStatement.close
Connection.close
When the number of statements in the pool reaches the maxStatements limit and a statement is requested that is
not found in the free pool, the pool removes the least-recently used statement from the free pool before a
creating a new PreparedStatement object . The statement-pooling component assumes that any SQL/MP
CONTROL statements in effect at the time of use or reuse are the same as those in effect at the time of
compilation. However, if the SQL/MP control statements are not the same, reuse of a PreparedStatement object
might result in unexpected behavior. The NonStop SQL/MP engine automatically recompiles queries when
certain conditions are met. Some of these conditions are:
A run-time version of a table has a different redefinition timestamp than the compile-time version of the
same table.
An existing open on a table was eliminated by a DDL or SQL utility operation.
Although these conditions only cause the PreparedsStatement to be recompiled once, avoid them so you can
gain maximum use of statement pooling. For detailed description on automatic recompilation, see the SQL/MP
Programming Manual for C.
For more information on statement pooling, see the Sun Microsystems JDBC 3.0 Specification.
JDBC/MP Connection-Pooling and Statement-Pooling
Properties
The JDBC/MP driver uses properties to determine the connection-pooling and statement-pooling implementation for a
user application. These properties are:
maxStatements Property
minPoolSize Property
maxPoolSize Property
poolLogging Property
TransactionMode Property
jdbcPropfile Property
For information on using these features, see Connection Pooling in a Basic DataSource Implementation and Statement
Pooling.
maxStatements Property
Sets the total number of PreparedStatement objects that the connection pool should cache. Statements are pooled
across the application, not just within a connection. Specify the maxStatements property as:
int
The integer can be 0 through n, where n is the maximum integer value. 0 disables statement pooling. The default is 0.
minPoolSize Property