Oracle10g JDBC

oracle.jdbc.pool
Class OracleConnectionCacheManager

java.lang.Object
  extended byoracle.jdbc.pool.OracleConnectionCacheManager

public class OracleConnectionCacheManager
extends java.lang.Object


Field Summary
static java.lang.String BUILD_DATE
           
static boolean PRIVATE_TRACE
           
static int REFRESH_ALL_CONNECTIONS
           
static int REFRESH_INVALID_CONNECTIONS
           
static boolean TRACE
           
 
Method Summary
 java.lang.String createCache(OracleDataSource ods, java.util.Properties cacheProperties)
          Creates a connection cache using an auto-generated Connection Cache name, and the supplied Connection Cache Properties.
 void createCache(java.lang.String cacheName, OracleDataSource ods, java.util.Properties cacheProperties)
          Creates a connection cache using the supplied Connection Cache name, and the Connection Cache Properties.
 void disableCache(java.lang.String cacheName)
          Disable a given connection cache
 void enableCache(java.lang.String cacheName)
          Enable a given connection cache
 boolean existsCache(java.lang.String cacheName)
          Check if connection cache exists.
 java.lang.String[] getCacheNameList()
          Get all the cache names managed by this connection cache manager
 java.util.Properties getCacheProperties(java.lang.String cacheName)
          Get the connection cache properties corresponding to the cache name.
static OracleConnectionCacheManager getConnectionCacheManagerInstance()
          Returns the static ConnectionCacheManager Instance.
 int[] getConnectionErrorCodes()
           
 int getNumberOfActiveConnections(java.lang.String cacheName)
          Get the number of connections already in use (checked out connections)
 int getNumberOfAvailableConnections(java.lang.String cacheName)
          Get the number connections in the cache, that are available for use
 boolean isFatalConnectionError(java.sql.SQLException se)
           
 void purgeCache(java.lang.String cacheName, boolean cleanupCheckedOutConnections)
          Purges Connections in the Connection Cache.
 void refreshCache(java.lang.String cacheName, int mode)
          Refreshes Connections in the Connection Cache.
 void reinitializeCache(java.lang.String cacheName, java.util.Properties cacheProperties)
          Reinitialize a connection cache using the new set of properties supplied
 void removeCache(java.lang.String cacheName, long waitTimeout)
          Removes the Connection Cache, associated with the given Connection Cache Name.
 void setConnectionErrorCodes(int[] fatalErrorCodes)
           
 void setConnectionPoolDataSource(java.lang.String cacheName, javax.sql.ConnectionPoolDataSource ds)
          Sets the ConnectionPoolDataSource that may be used to create the implicit connection cache.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REFRESH_INVALID_CONNECTIONS

public static final int REFRESH_INVALID_CONNECTIONS
See Also:
Constant Field Values

REFRESH_ALL_CONNECTIONS

public static final int REFRESH_ALL_CONNECTIONS
See Also:
Constant Field Values

TRACE

public static final boolean TRACE
See Also:
Constant Field Values

PRIVATE_TRACE

public static final boolean PRIVATE_TRACE
See Also:
Constant Field Values

BUILD_DATE

public static final java.lang.String BUILD_DATE
See Also:
Constant Field Values
Method Detail

getConnectionCacheManagerInstance

public static OracleConnectionCacheManager getConnectionCacheManagerInstance()
                                                                      throws java.sql.SQLException
Returns the static ConnectionCacheManager Instance. If necessary a new instance is created and returned to the caller.

Returns:
OracleConnectionCacheManager object
Throws:
java.sql.SQLException - if a database access error occurs

createCache

public java.lang.String createCache(OracleDataSource ods,
                                    java.util.Properties cacheProperties)
                             throws java.sql.SQLException
Creates a connection cache using an auto-generated Connection Cache name, and the supplied Connection Cache Properties. The Connection Cache created is associated with the DataSource Object provided.

Parameters:
ods - OracleDataSource object
cacheProperties - Connection Cache Properties for this cache
Returns:
The auto-generated Connection Cache Name
Throws:
java.sql.SQLException - if a database access error occurs

createCache

public void createCache(java.lang.String cacheName,
                        OracleDataSource ods,
                        java.util.Properties cacheProperties)
                 throws java.sql.SQLException
Creates a connection cache using the supplied Connection Cache name, and the Connection Cache Properties. The Connection Cache created is associated with the DataSource Object provided.

Parameters:
cacheName - Connection Cache Name
ods - OracleDataSource object
cacheProperties - Connection Cache Properties for this cache
Returns:
None
Throws:
java.sql.SQLException - if a database access error occurs

removeCache

public void removeCache(java.lang.String cacheName,
                        long waitTimeout)
                 throws java.sql.SQLException
Removes the Connection Cache, associated with the given Connection Cache Name. When a timeout value is specified, the remove processing pauses for the specified period of time, before proceeding to remove the connection cache.

Parameters:
cacheName - Connection Cache Name
waitTimeout - Timeout value, specified in seconds
Returns:
None
Throws:
java.sql.SQLException - if a database access error occurs

reinitializeCache

public void reinitializeCache(java.lang.String cacheName,
                              java.util.Properties cacheProperties)
                       throws java.sql.SQLException
Reinitialize a connection cache using the new set of properties supplied

Parameters:
cacheName - Connection Cache Name
Returns:
None
Throws:
java.sql.SQLException - if a database access error occurs

existsCache

public boolean existsCache(java.lang.String cacheName)
                    throws java.sql.SQLException
Check if connection cache exists.

Parameters:
cacheName - Connection Cache Name
Returns:
true or false, depending on whether the Connection Cache exists
Throws:
java.sql.SQLException - if a database access error occurs

enableCache

public void enableCache(java.lang.String cacheName)
                 throws java.sql.SQLException
Enable a given connection cache

Parameters:
cacheName - Connection Cache Name
Returns:
None
Throws:
java.sql.SQLException - if a database access error occurs

disableCache

public void disableCache(java.lang.String cacheName)
                  throws java.sql.SQLException
Disable a given connection cache

Parameters:
cacheName - Connection Cache Name
Returns:
None
Throws:
java.sql.SQLException - if a database access error occurs

refreshCache

public void refreshCache(java.lang.String cacheName,
                         int mode)
                  throws java.sql.SQLException
Refreshes Connections in the Connection Cache. Two modes are supported, REFRESH_INVALID_CONNECTIONS and REFRESH_ALL_CONNECTIONS

Parameters:
cacheName - Connection Cache Name
Returns:
None
Throws:
java.sql.SQLException - if a database access error occurs

purgeCache

public void purgeCache(java.lang.String cacheName,
                       boolean cleanupCheckedOutConnections)
                throws java.sql.SQLException
Purges Connections in the Connection Cache. A boolean flag indicates whether all connections in the cache are cleaned up(including checkedout connections) or just the connections in the cache

Parameters:
cacheName - Connection Cache Name
Returns:
None
Throws:
java.sql.SQLException - if a database access error occurs

getCacheProperties

public java.util.Properties getCacheProperties(java.lang.String cacheName)
                                        throws java.sql.SQLException
Get the connection cache properties corresponding to the cache name.

Parameters:
cacheName - Connection Cache Name
Returns:
Connection Cache Properties
Throws:
java.sql.SQLException - if a database access error occurs

getCacheNameList

public java.lang.String[] getCacheNameList()
                                    throws java.sql.SQLException
Get all the cache names managed by this connection cache manager

Returns:
List of Connection Cache Names, returned as a String Array
Throws:
java.sql.SQLException - if a database access error occurs

getNumberOfAvailableConnections

public int getNumberOfAvailableConnections(java.lang.String cacheName)
                                    throws java.sql.SQLException
Get the number connections in the cache, that are available for use

Parameters:
cacheName - Connection Cache Name
Returns:
Number of Connections in the Cache
Throws:
java.sql.SQLException - if a database access error occurs

getNumberOfActiveConnections

public int getNumberOfActiveConnections(java.lang.String cacheName)
                                 throws java.sql.SQLException
Get the number of connections already in use (checked out connections)

Parameters:
cacheName - Connection Cache Name
Returns:
Number of Connections checked out
Throws:
java.sql.SQLException - if a database access error occurs

setConnectionPoolDataSource

public void setConnectionPoolDataSource(java.lang.String cacheName,
                                        javax.sql.ConnectionPoolDataSource ds)
                                 throws java.sql.SQLException
Sets the ConnectionPoolDataSource that may be used to create the implicit connection cache. If the connections are already created on the connection cache, then an exception is thrown. If no connections are opened, then the new ConnectionPoolDataSource is used and may overwrite the previous one, if any.

Parameters:
cacheName - Connection Cache Name
ds - a datasource from which the Implicit Cache can create PooledConnections.
Returns:
None
Throws:
java.sql.SQLException - A ConnectionPoolDataSource object already exists and connections are already open.

isFatalConnectionError

public boolean isFatalConnectionError(java.sql.SQLException se)

setConnectionErrorCodes

public void setConnectionErrorCodes(int[] fatalErrorCodes)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

getConnectionErrorCodes

public int[] getConnectionErrorCodes()
                              throws java.sql.SQLException
Throws:
java.sql.SQLException

Oracle10g JDBC

Copyright © 1998,2004, Oracle. All rights reserved