| java.lang.Object org.apache.commons.dbcp.datasources.InstanceKeyDataSource org.apache.commons.dbcp.datasources.SharedPoolDataSource
SharedPoolDataSource | public class SharedPoolDataSource extends InstanceKeyDataSource (Code) | | A pooling DataSource appropriate for deployment within
J2EE environment. There are many configuration options, most of which are
defined in the parent class. All users (based on username) share a single
maximum number of Connections in this datasource.
author: John D. McNally version: $Revision: 500687 $ $Date: 2007-01-27 16:33:47 -0700 (Sat, 27 Jan 2007) $ |
Method Summary | |
public void | close() Close pool being maintained by this datasource. | public int | getMaxActive() The maximum number of active connections that can be allocated from
this pool at the same time, or non-positive for no limit. | public int | getMaxIdle() The maximum number of active connections that can remain idle in the
pool, without extra ones being released, or negative for no limit. | public int | getMaxWait() The maximum number of milliseconds that the pool will wait (when there
are no available connections) for a connection to be returned before
throwing an exception, or -1 to wait indefinitely. | public int | getNumActive() Get the number of active connections in the pool. | public int | getNumIdle() Get the number of idle connections in the pool. | protected synchronized PooledConnectionAndInfo | getPooledConnectionAndInfo(String username, String password) | public Reference | getReference() Returns a SharedPoolDataSource
Reference . | public void | setMaxActive(int maxActive) The maximum number of active connections that can be allocated from
this pool at the same time, or non-positive for no limit. | public void | setMaxIdle(int maxIdle) The maximum number of active connections that can remain idle in the
pool, without extra ones being released, or negative for no limit. | public void | setMaxWait(int maxWait) The maximum number of milliseconds that the pool will wait (when there
are no available connections) for a connection to be returned before
throwing an exception, or -1 to wait indefinitely. | protected void | setupDefaults(Connection con, String username) |
SharedPoolDataSource | public SharedPoolDataSource()(Code) | | Default no-arg constructor for Serialization
|
close | public void close() throws Exception(Code) | | Close pool being maintained by this datasource.
|
getMaxActive | public int getMaxActive()(Code) | | The maximum number of active connections that can be allocated from
this pool at the same time, or non-positive for no limit.
|
getMaxIdle | public int getMaxIdle()(Code) | | The maximum number of active connections that can remain idle in the
pool, without extra ones being released, or negative for no limit.
|
getMaxWait | public int getMaxWait()(Code) | | The maximum number of milliseconds that the pool will wait (when there
are no available connections) for a connection to be returned before
throwing an exception, or -1 to wait indefinitely. Will fail
immediately if value is 0.
The default is -1.
|
getNumActive | public int getNumActive()(Code) | | Get the number of active connections in the pool.
|
getNumIdle | public int getNumIdle()(Code) | | Get the number of idle connections in the pool.
|
setMaxActive | public void setMaxActive(int maxActive)(Code) | | The maximum number of active connections that can be allocated from
this pool at the same time, or non-positive for no limit.
The default is 8.
|
setMaxIdle | public void setMaxIdle(int maxIdle)(Code) | | The maximum number of active connections that can remain idle in the
pool, without extra ones being released, or negative for no limit.
The default is 8.
|
setMaxWait | public void setMaxWait(int maxWait)(Code) | | The maximum number of milliseconds that the pool will wait (when there
are no available connections) for a connection to be returned before
throwing an exception, or -1 to wait indefinitely. Will fail
immediately if value is 0.
The default is -1.
|
|
|