java.lang.Object
com.lilacsoftware.orca.DBManager.DBConnectionManager.DBConnectionPool
- Enclosing class:
- DBConnectionManager
- class DBConnectionManager.DBConnectionPool
- extends java.lang.Object
This inner class represents a connection pool. It creates new
connections on demand, up to a max number if specified.
It also makes sure a connection is still open before it is
returned to a client.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
checkedOut
private int checkedOut
freeConnections
private java.util.Vector freeConnections
maxConn
private int maxConn
name
private java.lang.String name
password
private java.lang.String password
URL
private java.lang.String URL
user
private java.lang.String user
DBConnectionManager.DBConnectionPool
protected DBConnectionManager.DBConnectionPool(java.lang.String name,
java.lang.String URL,
java.lang.String user,
java.lang.String password,
int maxConn)
- Creates new connection pool.
freeLocalConnection
protected void freeLocalConnection(java.sql.Connection con)
- Checks in a connection to the pool. Notify other Threads that
may be waiting for a connection.
getConnection
protected java.sql.Connection getConnection()
- Checks out a connection from the pool. If no free connection
is available, a new connection is created unless the max
number of connections has been reached. If a free connection
has been closed by the database, it's removed from the pool
and this method is called again recursively.
getConnection
protected java.sql.Connection getConnection(long timeout)
- Checks out a connection from the pool. If no free connection
is available, a new connection is created unless the max
number of connections has been reached. If a free connection
has been closed by the database, it's removed from the pool
and this method is called again recursively.
If no connection is available and the max number has been
reached, this method waits the specified time for one to be
checked in.
release
protected void release()
- Closes all available connections.
newConnection
private java.sql.Connection newConnection()
- Creates a new connection, using a userid and password
if specified.