public class ConnectionPool extends Object
Modifier and Type | Field and Description |
---|---|
static String |
_rcsid |
protected int |
activeConnections |
protected boolean |
closed |
protected long[] |
connectionCleanupTimeouts |
protected String |
dbURL |
protected boolean |
debug |
protected long |
expiration |
protected Connection[] |
freeConnections |
protected int |
freePointer |
protected Set<WrappedConnection> |
outstandingConnections |
protected String |
password |
protected String |
userName |
Constructor and Description |
---|
ConnectionPool(String dbURL,
String userName,
String password,
int maxConnections,
long expiration,
boolean debug)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
cleanupExpiredConnections(long currentTime)
Clean up expired connections.
|
void |
closePool()
Close down the pool.
|
void |
flushPool()
Flush the pool.
|
WrappedConnection |
getConnection()
Obtain a connection from the pool.
|
protected void |
release(Connection c) |
void |
releaseConnection(WrappedConnection connection) |
public static final String _rcsid
protected final String dbURL
protected final String userName
protected final String password
protected volatile int freePointer
protected volatile int activeConnections
protected volatile boolean closed
protected final Connection[] freeConnections
protected final long[] connectionCleanupTimeouts
protected final long expiration
protected final boolean debug
protected final Set<WrappedConnection> outstandingConnections
public WrappedConnection getConnection() throws SQLException, InterruptedException
SQLException
InterruptedException
public void flushPool()
public void closePool()
public void cleanupExpiredConnections(long currentTime)
public void releaseConnection(WrappedConnection connection)
protected void release(Connection c)