JDBC Type 2 Driver Programmer's Reference for SQL/MX Release 3.2.1 (H06.26+, J06.15+)
The connection is initialized with the JDBC/MX driver-specific properties when the
PooledConnection is obtained.
• By using the properties in the DataSource object, when the dataSourceName property is
empty. Connection pooling is disabled by default. Note that the default value for the
maxPoolSize property is -1, which disables connection pooling. See the DataSource interface
for the details on using these properties.
For troubleshooting application connection pooling, note the following details on how the feature
is implemented. JDBC/MX looks for the first available PooledConnection object and assigns
the object to the client requests for a connection. JDBC/MX ensures that the SQL/MX execution
environment and compilation environment remain the same for all the connections in the connection
pooling environment; that is, the environment is the same as when the initial connection was
obtained by the client session either from the pool or from a new physical connection.
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 and described as under JDBC/MX Properties:
• 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 maxPoolSize 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 catalog-schema combination are pooled together and managed
by the JDBC/MX 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” (page 38)
• “Controlling the Performance of ResultSet Processing” (page 38)
• “Troubleshooting Statement Pooling” (page 38)
Statement Pooling 37










