com.intersys.jdbc
Class CacheConnectionPoolDataSource

java.lang.Object
  extended bycom.intersys.jdbc.CacheDataSource
      extended bycom.intersys.jdbc.CacheConnectionPoolDataSource
All Implemented Interfaces:
javax.sql.ConnectionPoolDataSource, javax.sql.DataSource

public class CacheConnectionPoolDataSource
extends CacheDataSource
implements javax.sql.ConnectionPoolDataSource

CacheConnectionPoolDataSource object is an implementation of ConnectionPoolDataSource interface In addition to the apis defined by the interface, this class also includes a number of Cache specific apis. There are apis that can be used to limit (and view) the max connection pool size, view current pool size, and reset the current connection pool. Connections should always be obtained by calling getConnection apis, which are inherited from the DataSource class. getPooledConnection apis are meant for use within the driver only, and should not be used by the calling applications.


Constructor Summary
CacheConnectionPoolDataSource()
           
 
Method Summary
 int getMaxPoolSize()
          Returns the current Connection Pool max size
 int getPoolCount()
          Returns the current Connection Pool size
 javax.sql.PooledConnection getPooledConnection()
          IMPORTANT: this api SHOULD NOT be used to obtain a pooled connection.
 javax.sql.PooledConnection getPooledConnection(String usr, String pwd)
          IMPORTANT: this api SHOULD NOT be used to obtain a pooled connection.
 void restartConnectionPool()
          Restarts a Connection Pool.
 void setMaxPoolSize(int max)
          Sets a Connection Pool max size.
 
Methods inherited from class com.intersys.jdbc.CacheDataSource
getConnection, getConnection, getConnectionSecurityLevel, getDatabaseName, getDataSourceName, getDescription, getEventClass, getLoginTimeout, getLogWriter, getNodelay, getPassword, getPortNumber, getServerName, getServicePrincipalName, getURL, getUser, setConnectionSecurityLevel, setDatabaseName, setDataSourceName, setDescription, setEventClass, setLoginTimeout, setLogWriter, setNodelay, setPassword, setPortNumber, setServerName, setServicePrincipalName, setURL, setUser
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sql.ConnectionPoolDataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 

Constructor Detail

CacheConnectionPoolDataSource

public CacheConnectionPoolDataSource()
Method Detail

getPooledConnection

public javax.sql.PooledConnection getPooledConnection()
                                               throws SQLException
IMPORTANT: this api SHOULD NOT be used to obtain a pooled connection. Use getConnection() instead.

Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Throws:
SQLException

getPooledConnection

public javax.sql.PooledConnection getPooledConnection(String usr,
                                                      String pwd)
                                               throws SQLException
IMPORTANT: this api SHOULD NOT be used to obtain a pooled connection. Use getConnection(String user, String pwd) instead.

Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Throws:
SQLException

restartConnectionPool

public void restartConnectionPool()
                           throws SQLException
Restarts a Connection Pool. Closes all physical connections, and empties the Connection Pool.

Throws:
SQLException

getPoolCount

public int getPoolCount()
Returns the current Connection Pool size

Returns:
pool size

setMaxPoolSize

public void setMaxPoolSize(int max)
Sets a Connection Pool max size. If the max size is not set, it defaults to 40.

Parameters:
max - max pool size

getMaxPoolSize

public int getMaxPoolSize()
Returns the current Connection Pool max size

Returns:
max pool size