Name
ConnectionPool
Synopsis
|
Class Name: |
com.ora.jsp.sql.ConnectionPool |
|
Extends: |
None |
|
Implements: |
None |
Description
This class implements a connection pool. It’s the same class as
the
ConnectionPool
class described in Java Servlet
Programming (O’Reilly), and is copied with
permission from Jason Hunter. It’s used by the
DataSourceWrapper class to provide a JDBC 2.0
DataSource interface to the pool.
Class Summary
public class ConnectionPool {
// Constructor
public ConnectionPool(String dbURL, String user, String password,
String driverClassName, int initialConnections, int increment)
throws java.sql.SQLException, ClassNotFoundException;
// Methods
public java.sql.Connection getConnection( )
throws java.sql.SQLException;
public void returnConnection(java.sql.Connection returned);
}Constructor
-
public ConnectionPool(String dbURL, String user, String password, String driverClassName, int initialConnections, int increment) throws java.sql.SQLException, ClassNotFoundException Creates a connection pool for the specified JDBC URL using the specified JDBC driver class and database user ID and password. The specified number of connections is created initially, and the pool is expanded in the specified increments if the pool is empty when a new request is received.
Methods
-
public java.sql.Connection getConnection( ) throws java.sql.SQLException Returns a
Connectionfrom the pool.-
public void returnConnection(java.sql.Connection returned) Used by the connection pool client to return a
Connection ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access