| java.lang.Object net.myvietnam.mvncore.db.DBConnectionManager
DBConnectionManager | class DBConnectionManager (Code) | | This class is a Singleton that provides access to the
connection pool. A client gets access to the single
instance through the static getInstance() method
and can then check-out and check-in connections from a pool.
When the client shuts down it should call the release() method
to close all opened connections and do other clean up.
|
Inner Class :class DBConnectionPool | |
freeConnection | void freeConnection(Connection con)(Code) | | Returns a connection to the pool.
Parameters: con - The Connection |
getConnection | Connection getConnection()(Code) | | Returns an open connection. If no one is available, and the max
number of connections has not been reached, a new connection is
created.
Connection The connection or null |
getConnection | Connection getConnection(long time)(Code) | | Returns an open connection. If no one is available, and the max
number of connections has not been reached, a new connection is
created. If the max number has been reached, waits until one
is available or the specified time has elapsed.
Parameters: time - The number of milliseconds to wait Connection The connection or null |
release | boolean release()(Code) | | Closes all open connections.
true if the pool is empty and balancefalse if the pool has returned some connection to outside |
|
|