All Packages Class Hierarchy This Package Previous Next Index
Class oracle.jdbc.pool.OracleConnectionCacheImpl
java.lang.Object
|
+----oracle.jdbc.pool.OracleDataSource
|
+----oracle.jdbc.pool.OracleConnectionCacheImpl
- public class OracleConnectionCacheImpl
- extends OracleDataSource
- implements OracleConnectionCache, Serializable
-
DYNAMIC_SCHEME
-
-
FIXED_RETURN_NULL_SCHEME
-
-
FIXED_WAIT_SCHEME
-
-
OracleConnectionCacheImpl()
-
Default Constructor.
-
OracleConnectionCacheImpl(ConnectionPoolDataSource)
-
Create an OracleConnectionCacheImpl with the given
ConnectionPoolDataSource from which PooledConnections
have to created.
-
close()
-
Invoked by the ConnectionEventListener when an error occurs
on a PooledConnection/LogicalConnection signaling that it is no
longer good to be used and can be closed.
-
closePooledConnection(PooledConnection)
-
Invoked by the ConnectionEventListener when an error occurs
on a PooledConnection/LogicalConnection signaling that it is no
longer good to be used and can be closed.
-
getActiveSize()
- Return the total no of connections that are being used.
-
getCacheScheme()
- Return the Caching Scheme being used.
-
getCacheSize()
- Return the total no of connections in the Cache.
-
getConnection()
- Attempt to get a logical connection from the Cache.
-
getConnection(String, String)
- Attempt to get a logical connection from the Cache.
-
getMaxLimit()
- Return the Max limit on Connections.
-
getMinLimit()
- Return the minimum limit on the no of Connections.
-
getReference()
-
-
reusePooledConnection(PooledConnection)
-
Invoked by the ConnectionEventListener instance when Logical
connection handles are closed signaling that the PooledConnection
can be recycled into the pool for further use.
-
setCacheScheme(int)
- Set the Scheme for this Cache.
-
setConnectionPoolDataSource(ConnectionPoolDataSource)
- Associate a ConnectionPoolDataSource datasource to the Cache.
-
setMaxLimit(int)
- Set the maximum no of connections for the Cache.
-
setMinLimit(int)
- Set the minimum no of connections for the Cache.
DYNAMIC_SCHEME
public static final int DYNAMIC_SCHEME
FIXED_WAIT_SCHEME
public static final int FIXED_WAIT_SCHEME
FIXED_RETURN_NULL_SCHEME
public static final int FIXED_RETURN_NULL_SCHEME
OracleConnectionCacheImpl
public OracleConnectionCacheImpl() throws SQLException
-
Default Constructor. Should have an explicit call to
set the URL, User, Password and other DataSource details.
A ConnectionPoolDataSource is created with these options
from which PooledConnections can be created.
- Throws: SQLException
- error creating Cache
OracleConnectionCacheImpl
public OracleConnectionCacheImpl(ConnectionPoolDataSource ds) throws SQLException
-
Create an OracleConnectionCacheImpl with the given
ConnectionPoolDataSource from which PooledConnections
have to created. In which case, url, user name, password,
and other DataSource properties set on this Cache are
ignored.
- Parameters:
- ds - a datasource from which the Cache can create
PooledConnections.
- Throws: SQLException
- error creating Cache
setConnectionPoolDataSource
public void setConnectionPoolDataSource(ConnectionPoolDataSource ds) throws SQLException
- Associate a ConnectionPoolDataSource datasource to the Cache.
If one already exists and Connections are already opened then
an Exception is thrown. If no connections are opened, then the
new ConnectionPoolDataSource overwrites the previous one.
- Parameters:
- ds - a datasource from which the Cache can create
PooledConnections.
- Throws: SQLException
- A ConnectionPoolDataSource object
already exists and connections are already open.
getConnection
public Connection getConnection() throws SQLException
- Attempt to get a logical connection from the Cache. May return
null depending upon the Schemes selected. Either a
ConnectionPoolDataSource must be Set or url, username, password
or Other JNDI attributes should be set on this Cache before you
attempt to open Connections.
- Returns:
- Connection A logical Connection Object.
- Throws: SQLException
- error creating Connection Object.
- Overrides:
- getConnection in class OracleDataSource
getConnection
public Connection getConnection(String user,
String passwd) throws SQLException
- Attempt to get a logical connection from the Cache. May return
null depending upon the Schemes selected. User and password
arguments should match the one given either directly or
from ConnectionPoolDataSource.
- Returns:
- Connection A logical Connection Object.
- Throws: SQLException
- error creating Connection Object.
- Overrides:
- getConnection in class OracleDataSource
reusePooledConnection
public void reusePooledConnection(PooledConnection pc) throws SQLException
-
Invoked by the ConnectionEventListener instance when Logical
connection handles are closed signaling that the PooledConnection
can be recycled into the pool for further use.
- Parameters:
- pc - The pooled connection object that needs to be recylced.
- Throws: SQLException
- error in recycling the PooledConnection.
closePooledConnection
public void closePooledConnection(PooledConnection pc) throws SQLException
-
Invoked by the ConnectionEventListener when an error occurs
on a PooledConnection/LogicalConnection signaling that it is no
longer good to be used and can be closed.
- Parameters:
- pc - The pooled connection object that has to be closed
because of an error.
- Throws: SQLException
- error in closing the PooledConnection
close
public void close() throws SQLException
-
Invoked by the ConnectionEventListener when an error occurs
on a PooledConnection/LogicalConnection signaling that it is no
longer good to be used and can be closed.
- Parameters:
- PooledConnection - The pooled connection object that has to
be closed because of an error.
- Throws: SQLException
- error in closing the PooledConnection
setMinLimit
public void setMinLimit(int l) throws SQLException
- Set the minimum no of connections for the Cache.
- Parameters:
- l - Minimum no. of Connections.
getMinLimit
public int getMinLimit()
- Return the minimum limit on the no of Connections.
- Returns:
- minimum limit on the no of Connections.
setMaxLimit
public void setMaxLimit(int l) throws SQLException
- Set the maximum no of connections for the Cache.
- Parameters:
- l - maximum no. of Connections.
getMaxLimit
public int getMaxLimit()
- Return the Max limit on Connections.
- Returns:
- int Max no of Connections that can be opened.
getCacheScheme
public int getCacheScheme()
- Return the Caching Scheme being used.
- Returns:
- the caching scheme.
setCacheScheme
public void setCacheScheme(int s) throws SQLException
- Set the Scheme for this Cache. Possible values are
OracleConnectionCacheImpl.DYNAMIC_SCHEME
OracleConnectionCacheImpl.FIXED_RETURN_NULL_SCHEME
- Parameters:
- int - Caching Scheme
getActiveSize
public int getActiveSize()
- Return the total no of connections that are being used.
- Returns:
- total no of active connections.
getCacheSize
public int getCacheSize()
- Return the total no of connections in the Cache.
- Returns:
- total no of connections opened.
getReference
public Reference getReference() throws NamingException
- Overrides:
- getReference in class OracleDataSource
All Packages Class Hierarchy This Package Previous Next Index