Begin changeConnection pooling

There are two classes of connection pooling in the Toolbox: AS400ConnectionPool, a pool of AS400 objects, and AS400JDBCConnectionPool, a pool of JDBC connections (and part of the Toolbox JDBC 2.0 Optional Package enhancements).

A connection pool is used to share connections and manage the number of connections a user can have to AS/400. The AS400ConnectionPool class manages a pool of AS400 objects. The AS400JDBCConnectionPool class represents a pool of AS400JDBCConnection objects that are available for use by a Java program.

A connection pool of either type keeps track of the number of connections it creates. Using methods inherited from ConnectionPool, you can set several connection pool properties, including:

Retrieve a connection by specifying the system name, user id, and (optionally) the password. After retrieving the connection, the application uses it and then returns it to the pool. One benefit of using a connection pool is better performance, because you avoid connect time when use a connection the second time. You can ensure that the time used to create connections occurs when the pool is created by filling the pool with active (preconnected) connections.

See managing connections for more information about managing when a connection to AS/400 is opened when using the AS400ConnectionPool classes.

Examples