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

Variable Index

 o DYNAMIC_SCHEME
 o FIXED_RETURN_NULL_SCHEME
 o FIXED_WAIT_SCHEME

Constructor Index

 o OracleConnectionCacheImpl()

Default Constructor.

 o OracleConnectionCacheImpl(ConnectionPoolDataSource)

Create an OracleConnectionCacheImpl with the given ConnectionPoolDataSource from which PooledConnections have to created.

Method Index

 o 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.

 o 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.

 o getActiveSize()
Return the total no of connections that are being used.
 o getCacheScheme()
Return the Caching Scheme being used.
 o getCacheSize()
Return the total no of connections in the Cache.
 o getConnection()
Attempt to get a logical connection from the Cache.
 o getConnection(String, String)
Attempt to get a logical connection from the Cache.
 o getMaxLimit()
Return the Max limit on Connections.
 o getMinLimit()
Return the minimum limit on the no of Connections.
 o getReference()
 o 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.

 o setCacheScheme(int)
Set the Scheme for this Cache.
 o setConnectionPoolDataSource(ConnectionPoolDataSource)
Associate a ConnectionPoolDataSource datasource to the Cache.
 o setMaxLimit(int)
Set the maximum no of connections for the Cache.
 o setMinLimit(int)
Set the minimum no of connections for the Cache.

Variables

 o DYNAMIC_SCHEME
 public static final int DYNAMIC_SCHEME
 o FIXED_WAIT_SCHEME
 public static final int FIXED_WAIT_SCHEME
 o FIXED_RETURN_NULL_SCHEME
 public static final int FIXED_RETURN_NULL_SCHEME

Constructors

 o 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
 o 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

Methods

 o 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.
 o 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
 o 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
 o 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.
 o 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
 o 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
 o setMinLimit
 public void setMinLimit(int l) throws SQLException
Set the minimum no of connections for the Cache.

Parameters:
l - Minimum no. of Connections.
 o getMinLimit
 public int getMinLimit()
Return the minimum limit on the no of Connections.

Returns:
minimum limit on the no of Connections.
 o setMaxLimit
 public void setMaxLimit(int l) throws SQLException
Set the maximum no of connections for the Cache.

Parameters:
l - maximum no. of Connections.
 o getMaxLimit
 public int getMaxLimit()
Return the Max limit on Connections.

Returns:
int Max no of Connections that can be opened.
 o getCacheScheme
 public int getCacheScheme()
Return the Caching Scheme being used.

Returns:
the caching scheme.
 o 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
 o getActiveSize
 public int getActiveSize()
Return the total no of connections that are being used.

Returns:
total no of active connections.
 o getCacheSize
 public int getCacheSize()
Return the total no of connections in the Cache.

Returns:
total no of connections opened.
 o getReference
 public Reference getReference() throws NamingException
Overrides:
getReference in class OracleDataSource

All Packages  Class Hierarchy  This Package  Previous  Next  Index