DB Connection Pooling framework provides connection pooling for
the JDBC API. A plethora of options and settings allow the developer
to control how the pooling works. Automatic reconnection code is
one of the built in features of this flexible framework.
Some of the advantages of this pooling api include:
- Automatic reconnect code when a connection
dies, including re-execution of the query that was attempted.
- Control over the maximum size of the pool
and the preferred size of the pool.
- Logging of all database access statements
to the JDBC DriverManager's LogWriter.
- Waiting for connection to be available when
maximum number of connections is reached.
The api is free for use and is comparable to
other JDBC Database Connection Pooling apis on the market.
The pooled connections that are returned by
the DB Connection Pooling product implement the
java.sql.Connection interface, so they can be used in any
existing application that uses JDBC Connection objects with minimal
To start using the DB Connection Pooling framework
in an existing application, just change your code from:
Driver jdbcDriverInstance = ( Driver ) Class.forName( aDriver ).newInstance();
DriverManager.registerDriver( jdbcDriverInstance );
Connection connection = DriverManager.getConnection( aURL, aUserID, aPassword );
// do something
to code that looks like:
DBConnectionPoolManager.initializeDriver( aDriver );
DBConnectionPool pool = DBConnectionPoolManager.getInstance().getPool( aURL,
pool.setPassword( aPassword );
Connection connection = pool.getDBConnection();
// do something
Look at the
JavaDocs, and the
User's Guide to see the abilities of these classes.