JDBC Type 2 Driver Programmer's Reference for SQL/MX Release 3.2.1 (H06.26+, J06.15+)

A process (JVM process) can have multiple SQL/MX contexts within a process.
Holdable Cursors
JDBC/MX driver supports the holdablity attribute for the ResultSet. To use holdable cursors in
your JDBC applications, follow these guidelines:
Use one of the following constants for the holdablity attribute:
com.tandem.sqlmx.SQLMXResultSet.HOLD_CURSORS_OVER_COMMIT
Ensure that when the application calls the method Connection.commit or
Connection.rollback, the HOLD_CURSORS_OVER_COMMIT constant indicates
that ResultSet objects are not closed.
com.tandem.sqlmx.SQLMXResultSet.CLOSE_CURSORS_AT_COMMIT
Ensure that when the application calls the method Connection.commit or
Connection.rollback, the CLOSE_CURSORS_AT_COMMIT constant indicates
that ResultSetobjects are closed.
For the ResultSet objects to be holdable over a commit operation, ensure that the SQL
statement that generates the ResultSet has either stream access mode, or embedded update
or delete for table references.
Use either of the following methods in SQLMXConnection objects to create result sets with
holdable cursors over commit:
createStatement(int resultSetType, int resultSetConcurrency,
int resultSetHoldability)
prepareStatement(String sql, int resultSetType,
int resultSetConcurrency, int resultSetHoldability)
For a demonstration in a sample program, see the holdJdbcMx.java program description.
Connection Pooling
JDBC/MX provides an implementation of connection pooling, where a cache of physical database
connections are assigned to a client connection session and reused for the database activity. Once
the client session is closed, the physical connection is put back into cache for subsequent use. This
implementation contrasts to the basic DataSource object implementation, where a one-to-one
correspondence exists between client Connection object and the physical database connection.
Your applications can use connection pooling in the following ways:
“Connection Pooling by an Application Server (page 35)
“Connection Pooling Using the Basic DataSource API” (page 36)
“Connection Pooling with the DriverManager Class (page 37)
Connection Pooling by an Application Server
Usually, in a three-tier environment, the application server implements the connection pooling
component. How to implement this component is described in these topics:
“Guidelines for Implementing an Application Server to Use Connection Pooling (page 35)
“Standard ConnectionPoolDataSource Object Properties (page 36)
Guidelines for Implementing an Application Server to Use Connection Pooling
Pooling the application server maintains a cache of the PooledConnection objects created
by using ConnectionPoolDataSource interface. When the client requests a connection
Holdable Cursors 35