gnu.beanfactory.jdbc
Class BasicConnectionPool

java.lang.Object
  |
  +--gnu.beanfactory.jdbc.BasicConnectionPool
All Implemented Interfaces:
ConnectionPool
Direct Known Subclasses:
BitmechanicConnectionPool

public class BasicConnectionPool
extends java.lang.Object
implements ConnectionPool

Implementation of the ConnectionPool interface that does not implement pooling. This class is useful with batch processing where a pooling mechanism can cause problems. It is also useful in conjunction with the WebLogic connection pool, which exposes itself as a "normal" JDBC driver.


Constructor Summary
BasicConnectionPool()
           
 
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 autoCommit)
           
 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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicConnectionPool

public BasicConnectionPool()
Method Detail

getMaxConnections

public int getMaxConnections()
Description copied from interface: ConnectionPool
Max allowable number of open connections.
Specified by:
getMaxConnections in interface ConnectionPool

setMaxConnections

public void setMaxConnections(int i)
Description copied from interface: ConnectionPool
Max allowable number of open connections.
Specified by:
setMaxConnections in interface ConnectionPool

setIdleTimeout

public void setIdleTimeout(int i)
Description copied from interface: ConnectionPool
Max number of seconds a connection can sit unused before it is closed.
Specified by:
setIdleTimeout in interface ConnectionPool

getIdleTimeout

public int getIdleTimeout()
Description copied from interface: ConnectionPool
Max number of seconds a connection can sit unused before it is closed.
Specified by:
getIdleTimeout in interface ConnectionPool

getCheckoutTimeout

public int getCheckoutTimeout()
Description copied from interface: ConnectionPool
Max number of seconds a connection can be checked out from the pool.
Specified by:
getCheckoutTimeout in interface ConnectionPool

setCheckoutTimeout

public void setCheckoutTimeout(int i)
Description copied from interface: ConnectionPool
Max number of seconds a connection can be checked out from the pool.
Specified by:
setCheckoutTimeout in interface ConnectionPool

getMaxCheckout

public int getMaxCheckout()
Description copied from interface: ConnectionPool
Max number of times a particular connection can be used before it is closed.
Specified by:
getMaxCheckout in interface ConnectionPool

setMaxCheckout

public void setMaxCheckout(int i)
Description copied from interface: ConnectionPool
Max number of times a particular connection can be used before it is closed.
Specified by:
setMaxCheckout in interface ConnectionPool

setCacheStatements

public void setCacheStatements(boolean cache)
Description copied from interface: ConnectionPool
Statement Cache
Specified by:
setCacheStatements in interface ConnectionPool

getCacheStatements

public boolean getCacheStatements()
Description copied from interface: ConnectionPool
Statement Cache
Specified by:
getCacheStatements in interface ConnectionPool

getPoolName

public java.lang.String getPoolName()
Description copied from interface: ConnectionPool
Name of the pool.
Specified by:
getPoolName in interface ConnectionPool

getAutoCommit

public boolean getAutoCommit()
Specified by:
getAutoCommit in interface ConnectionPool

setAutoCommit

public void setAutoCommit(boolean autoCommit)
Specified by:
setAutoCommit in interface ConnectionPool

setPoolName

public void setPoolName(java.lang.String name)
Description copied from interface: ConnectionPool
Name of the pool.
Specified by:
setPoolName in interface ConnectionPool

getUrl

public java.lang.String getUrl()
Description copied from interface: ConnectionPool
JDBC URL to the database.
Specified by:
getUrl in interface ConnectionPool

setUrl

public void setUrl(java.lang.String url)
Description copied from interface: ConnectionPool
JDBC URL to the database.
Specified by:
setUrl in interface ConnectionPool

setDriver

public void setDriver(java.lang.String driver)
Description copied from interface: ConnectionPool
Underlying JDBC driver class name.
Specified by:
setDriver in interface ConnectionPool

getDriver

public java.lang.String getDriver()
Description copied from interface: ConnectionPool
Underlying JDBC driver class name.
Specified by:
getDriver in interface ConnectionPool

setUser

public void setUser(java.lang.String user)
Description copied from interface: ConnectionPool
Username used to connect to the database.
Specified by:
setUser in interface ConnectionPool

getUser

public java.lang.String getUser()
Description copied from interface: ConnectionPool
Username used to connect to the database.
Specified by:
getUser in interface ConnectionPool

setPassword

public void setPassword(java.lang.String password)
Description copied from interface: ConnectionPool
Password used to connect to the database.
Specified by:
setPassword in interface ConnectionPool

getPassword

public java.lang.String getPassword()
Description copied from interface: ConnectionPool
Password used to connect to the database.
Specified by:
getPassword in interface ConnectionPool

getPooledUrl

public java.lang.String getPooledUrl()
Description copied from interface: ConnectionPool
If the connection pool exposes the connections through a "virtual" driver, this read-only property will provide the name.
Specified by:
getPooledUrl in interface ConnectionPool

postInit

public void postInit()
              throws java.sql.SQLException,
                     EncapsulatedException
Specified by:
postInit in interface ConnectionPool

obtainConnection

public java.sql.Connection obtainConnection()
                                     throws java.sql.SQLException
Description copied from interface: ConnectionPool
Obtains a connection from the pool.
Specified by:
obtainConnection in interface ConnectionPool

releaseConnection

public void releaseConnection(java.sql.Connection c)
Description copied from interface: ConnectionPool
Releases a connection. Should NOT throw an exception under any circumstances.
Specified by:
releaseConnection in interface ConnectionPool

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setTracing

public void setTracing(boolean flag)
Specified by:
setTracing in interface ConnectionPool

getTracing

public boolean getTracing()
Specified by:
getTracing in interface ConnectionPool