gnu.beanfactory.jdbc
Interface ConnectionPool

All Known Implementing Classes:
BasicConnectionPool, BitmechanicConnectionPool

public interface ConnectionPool

ConnectionPool is a generic interface for configuring and providing access to JDBC connections. All times are specified in seconds.


Method Summary
 boolean getAutoCommit()
           
 boolean getCacheStatements()
          Statement Cache
 int getCheckoutTimeout()
          Max number of seconds a connection can be checked out from the pool.
 java.lang.String getDriver()
          Underlying JDBC driver class name.
 int getIdleTimeout()
          Max number of seconds a connection can sit unused before it is closed.
 int getMaxCheckout()
          Max number of times a particular connection can be used before it is closed.
 int getMaxConnections()
          Max allowable number of open connections.
 java.lang.String getPassword()
          Password used to connect to the database.
 java.lang.String getPooledUrl()
          If the connection pool exposes the connections through a "virtual" driver, this read-only property will provide the name.
 java.lang.String getPoolName()
          Name of the pool.
 boolean getTracing()
           
 java.lang.String getUrl()
          JDBC URL to the database.
 java.lang.String getUser()
          Username used to connect to the database.
 java.sql.Connection obtainConnection()
          Obtains a connection from the pool.
 void postInit()
           
 void releaseConnection(java.sql.Connection c)
          Releases a connection.
 void setAutoCommit(boolean c)
           
 void setCacheStatements(boolean cache)
          Statement Cache
 void setCheckoutTimeout(int i)
          Max number of seconds a connection can be checked out from the pool.
 void setDriver(java.lang.String driver)
          Underlying JDBC driver class name.
 void setIdleTimeout(int i)
          Max number of seconds a connection can sit unused before it is closed.
 void setMaxCheckout(int i)
          Max number of times a particular connection can be used before it is closed.
 void setMaxConnections(int i)
          Max allowable number of open connections.
 void setPassword(java.lang.String password)
          Password used to connect to the database.
 void setPoolName(java.lang.String name)
          Name of the pool.
 void setTracing(boolean flag)
           
 void setUrl(java.lang.String url)
          JDBC URL to the database.
 void setUser(java.lang.String user)
          Username used to connect to the database.
 

Method Detail

getMaxConnections

public int getMaxConnections()
Max allowable number of open connections.

setMaxConnections

public void setMaxConnections(int i)
Max allowable number of open connections.

setIdleTimeout

public void setIdleTimeout(int i)
Max number of seconds a connection can sit unused before it is closed.

getIdleTimeout

public int getIdleTimeout()
Max number of seconds a connection can sit unused before it is closed.

getCheckoutTimeout

public int getCheckoutTimeout()
Max number of seconds a connection can be checked out from the pool.

setCheckoutTimeout

public void setCheckoutTimeout(int i)
Max number of seconds a connection can be checked out from the pool.

getMaxCheckout

public int getMaxCheckout()
Max number of times a particular connection can be used before it is closed.

setMaxCheckout

public void setMaxCheckout(int i)
Max number of times a particular connection can be used before it is closed.

setCacheStatements

public void setCacheStatements(boolean cache)
Statement Cache

getCacheStatements

public boolean getCacheStatements()
Statement Cache

getPoolName

public java.lang.String getPoolName()
Name of the pool.

setPoolName

public void setPoolName(java.lang.String name)
Name of the pool.

getUrl

public java.lang.String getUrl()
JDBC URL to the database.

setUrl

public void setUrl(java.lang.String url)
JDBC URL to the database.

setDriver

public void setDriver(java.lang.String driver)
Underlying JDBC driver class name.

getDriver

public java.lang.String getDriver()
Underlying JDBC driver class name.

setUser

public void setUser(java.lang.String user)
Username used to connect to the database.

getUser

public java.lang.String getUser()
Username used to connect to the database.

setPassword

public void setPassword(java.lang.String password)
Password used to connect to the database.

getPassword

public java.lang.String getPassword()
Password used to connect to the database.

getAutoCommit

public boolean getAutoCommit()

setAutoCommit

public void setAutoCommit(boolean c)

getPooledUrl

public java.lang.String getPooledUrl()
If the connection pool exposes the connections through a "virtual" driver, this read-only property will provide the name.

postInit

public void postInit()
              throws java.sql.SQLException,
                     EncapsulatedException

obtainConnection

public java.sql.Connection obtainConnection()
                                     throws java.sql.SQLException
Obtains a connection from the pool.

releaseConnection

public void releaseConnection(java.sql.Connection c)
Releases a connection. Should NOT throw an exception under any circumstances.

getTracing

public boolean getTracing()

setTracing

public void setTracing(boolean flag)