| |
|
| java.lang.Object org.geotools.data.jdbc.ConnectionPool
ConnectionPool | final public class ConnectionPool (Code) | | Provides a ConnectionPool that can be used by multiple data sources to get connections to a
single database.
This class should not be subclassed.
author: Sean Geoghegan, Defence Science and Technology Organisation author: Chris Holmes version: $Id: ConnectionPool.java 27862 2007-11-12 19:51:19Z desruisseaux $DataSourceDataSourceUtilDataSourceFinder |
Method Summary | |
public void | close() Closes all the PooledConnections in the the ConnectionPool.
The current behaviour is to first close all the used connections,
then close all the available connections. | public Connection | getConnection() Gets a Connection from the Connection Pool. | public boolean | isClosed() Checks whether the ConnectionPool has been closed.
True if the connection pool is closed. |
ConnectionPool | public ConnectionPool(ConnectionPoolDataSource cpDataSource)(Code) | | Creates a new Connection Pool using a ConnectionPoolDataSource.
This constructor will also spawn a thread for cleaning the connection pool every 30 seconds.
Parameters: cpDataSource - The Connection Pool Data Source to get PooledConnections from. |
close | public void close()(Code) | | Closes all the PooledConnections in the the ConnectionPool.
The current behaviour is to first close all the used connections,
then close all the available connections. This method will also set
the state of the ConnectionPool to closed, caused any future calls
to getConnection to throw an SQLException.
|
getConnection | public Connection getConnection() throws SQLException(Code) | | Gets a Connection from the Connection Pool.
If no available connections exist a new connection will be created and added to the pool.
When the returned connection is closed it will be added to the connection pool for other
requests to this method.
A Connection from the ConnectionPool. throws: SQLException - If an error occurs getting the connection or if the connection pool has been closed by a previous call to close(). |
isClosed | public boolean isClosed()(Code) | | Checks whether the ConnectionPool has been closed.
True if the connection pool is closed. If the Pool is closedfuture calls to getConnection will throw an SQLException. |
|
|
|