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

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

public class JDBCDiskCachePoolAccess
extends 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 String DEFAULT_POOL_NAME
          The defualt Pool Name to which the connetion pool will be keyed.
 
Constructor Summary
JDBCDiskCachePoolAccess(String poolName)
          Configures the pool name to use for the pool access.
 
Method Summary
 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.
 String getPoolName()
           
 String getPoolUrl()
           
 void logDriverStats()
           
 void setPoolName(String poolName)
           
 void setupDriver(String connectURI, String userName, 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 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(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 Connection getConnection()
                         throws SQLException
Gets a connection from the pool.

Returns:
Connection
Throws:
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 Exception
Throws:
Exception

getPoolUrl

public String getPoolUrl()
Returns:
Returns the poolUrl.

setPoolName

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

getPoolName

public String getPoolName()
Returns:
Returns the poolName.

setupDriver

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

logDriverStats

public void logDriverStats()
                    throws Exception
Throws:
Exception


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