com.jdbaccess.db
Class ConnPool

java.lang.Object
  extended by com.jdbaccess.db.ConnPool

public class ConnPool
extends java.lang.Object


Field Summary
protected  java.util.Hashtable cachePool
           
protected  boolean debugMode
           
protected  DataSource ds
           
protected  int maxCachePoolSize
           
protected  int maxOpenConnections
           
protected  int minCachePoolSize
           
protected  java.lang.String name
           
protected  java.util.Hashtable usedPool
           
 
Constructor Summary
ConnPool(DataSource ds)
           
ConnPool(DataSource ds, int minCachePoolSize, int maxCachePoolSize, int maxOpenConnections)
           
ConnPool(java.lang.String name, DataSource ds)
           
ConnPool(java.lang.String name, DataSource ds, int minCachePoolSize, int maxCachePoolSize, int maxOpenConnections)
           
 
Method Summary
 void commit(int connId)
           
 void deleteConnectionFromUsePool(int connId)
           
 void end()
           
 java.sql.Connection findConnection(int connId)
           
 int getConnection()
          get a new connection out of pool
 void releaseConnection(int connId)
          release connection back to pool
 void rollback(int connId)
           
 void setDebugModeOff()
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugMode

protected boolean debugMode

ds

protected DataSource ds

name

protected java.lang.String name

minCachePoolSize

protected int minCachePoolSize

maxCachePoolSize

protected int maxCachePoolSize

maxOpenConnections

protected int maxOpenConnections

cachePool

protected java.util.Hashtable cachePool

usedPool

protected java.util.Hashtable usedPool
Constructor Detail

ConnPool

public ConnPool(DataSource ds)

ConnPool

public ConnPool(java.lang.String name,
                DataSource ds)

ConnPool

public ConnPool(DataSource ds,
                int minCachePoolSize,
                int maxCachePoolSize,
                int maxOpenConnections)

ConnPool

public ConnPool(java.lang.String name,
                DataSource ds,
                int minCachePoolSize,
                int maxCachePoolSize,
                int maxOpenConnections)
Method Detail

setDebugModeOff

public void setDebugModeOff()

start

public void start()
           throws ApplicationException
Throws:
ApplicationException

end

public void end()
         throws ApplicationException
Throws:
ApplicationException

getConnection

public int getConnection()
                  throws ApplicationException
get a new connection out of pool

Returns:
a new connection id
Throws:
java.sql.SQLException - TODO test if a connection is not ok anymore (repairCachePool)
ApplicationException

findConnection

public java.sql.Connection findConnection(int connId)

releaseConnection

public void releaseConnection(int connId)
                       throws ApplicationException
release connection back to pool

Parameters:
connId -
Throws:
java.sql.SQLException
ApplicationException

deleteConnectionFromUsePool

public void deleteConnectionFromUsePool(int connId)
                                 throws ApplicationException
Throws:
ApplicationException

commit

public void commit(int connId)
            throws ApplicationException
Throws:
ApplicationException

rollback

public void rollback(int connId)
              throws ApplicationException
Throws:
ApplicationException