org.apache.jcs.auxiliary.disk.jdbc
Class JDBCDiskCachePoolAccess

java.lang.Object
  extended by org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCachePoolAccess

public class JDBCDiskCachePoolAccess
extends java.lang.Object

This class provides access to the connection pool. It ensures that the various resources that need to access the tables will be able to use the same pool.

Author:
Aaron Smuts

Field Summary
static java.lang.String DEFAULT_POOL_NAME
          The defualt Pool Name to which the connetion pool will be keyed.
 
Constructor Summary
JDBCDiskCachePoolAccess(java.lang.String poolName)
          Configures the pool name to use for the pool access.
 
Method Summary
 java.sql.Connection getConnection()
          Gets a connection from the pool.
 int getNumActiveInPool()
          How many are active in the pool.
 int getNumIdleInPool()
          How many are idle in the pool.
 java.lang.String getPoolName()
           
 java.lang.String getPoolUrl()
           
 void logDriverStats()
           
 void setPoolName(java.lang.String poolName)
           
 void setupDriver(java.lang.String connectURI, java.lang.String userName, java.lang.String password, int maxActive)
           
 void shutdownDriver()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_POOL_NAME

public static final java.lang.String DEFAULT_POOL_NAME
The defualt Pool Name to which the connetion pool will be keyed.

See Also:
Constant Field Values
Constructor Detail

JDBCDiskCachePoolAccess

public JDBCDiskCachePoolAccess(java.lang.String poolName)
Configures the pool name to use for the pool access.

This pool name should be unique to the database. It is used as part of the URL each time we lookup a connection from the driver manager.

Parameters:
poolName -
Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Gets a connection from the pool.

Returns:
Connection
Throws:
java.sql.SQLException

getNumIdleInPool

public int getNumIdleInPool()
How many are idle in the pool.

Returns:
number idle

getNumActiveInPool

public int getNumActiveInPool()
How many are active in the pool.

Returns:
number active

shutdownDriver

public void shutdownDriver()
                    throws java.lang.Exception
Throws:
java.lang.Exception

getPoolUrl

public java.lang.String getPoolUrl()
Returns:
Returns the poolUrl.

setPoolName

public void setPoolName(java.lang.String poolName)
Parameters:
poolName - The poolName to set.

getPoolName

public java.lang.String getPoolName()
Returns:
Returns the poolName.

setupDriver

public void setupDriver(java.lang.String connectURI,
                        java.lang.String userName,
                        java.lang.String password,
                        int maxActive)
                 throws java.lang.Exception
Parameters:
connectURI -
userName -
password -
maxActive - max connetions
Throws:
java.lang.Exception

logDriverStats

public void logDriverStats()
                    throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.