org.dbforms.conprovider
Class JakartaConnectionProvider

java.lang.Object
  extended by org.dbforms.conprovider.AbstractConnectionProvider
      extended by org.dbforms.conprovider.JakartaConnectionProvider

public class JakartaConnectionProvider
extends AbstractConnectionProvider

Connection provider for Apache Jakarta commons-dbcp.
See http://jakarta.apache.org/commons/dbcp.html for further informations.

Author:
Luca Fossato

Field Summary
protected static String CP_PROPS_MAX_ACTIVE
          the maximum number of active connections that can be allocated from this pool at the same time, or zero for no limit.
protected static String CP_PROPS_MAX_IDLE
          The maximum number of active connections that can remain idle in the pool, without extra ones being released, or zero for no limit.
protected static String CP_PROPS_MAX_WAIT
          The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or -1 to wait indefinitely.
protected static String CP_PROPS_USE_LOG
          log the dataSource object statements using log4j category class
protected static String CP_PROPS_VALIDATION_QUERY
          The SQL query that will be used to validate connections from this pool before returning them to the caller.
 
Constructor Summary
JakartaConnectionProvider()
          Default constructor.
 
Method Summary
protected  Connection getConnection()
          Get a JDBC Connection
protected  void init()
          Initialize the Jakarta Commons connection pool.
 
Methods inherited from class org.dbforms.conprovider.AbstractConnectionProvider
getConnection, getLastToken, getPrefs, setPrefs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CP_PROPS_VALIDATION_QUERY

protected static final String CP_PROPS_VALIDATION_QUERY
The SQL query that will be used to validate connections from this pool before returning them to the caller.

See Also:
Constant Field Values

CP_PROPS_MAX_ACTIVE

protected static final String CP_PROPS_MAX_ACTIVE
the maximum number of active connections that can be allocated from this pool at the same time, or zero for no limit.

See Also:
Constant Field Values

CP_PROPS_MAX_IDLE

protected static final String CP_PROPS_MAX_IDLE
The maximum number of active connections that can remain idle in the pool, without extra ones being released, or zero for no limit.

See Also:
Constant Field Values

CP_PROPS_MAX_WAIT

protected static final String CP_PROPS_MAX_WAIT
The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or -1 to wait indefinitely.

See Also:
Constant Field Values

CP_PROPS_USE_LOG

protected static final String CP_PROPS_USE_LOG
log the dataSource object statements using log4j category class

See Also:
Constant Field Values
Constructor Detail

JakartaConnectionProvider

public JakartaConnectionProvider()
                          throws Exception
Default constructor.

Throws:
Exception - Description of the Exception
Exception - because of the throws Exception clause of the init method.
Method Detail

getConnection

protected Connection getConnection()
                            throws SQLException
Get a JDBC Connection

Specified by:
getConnection in class AbstractConnectionProvider
Returns:
a JDBC Connection
Throws:
SQLException - Description of the Exception

init

protected void init()
             throws Exception
Initialize the Jakarta Commons connection pool.

Specified by:
init in class AbstractConnectionProvider
Throws:
Exception - if any error occurs


Copyright © 2002-2006 DbForms. All Rights Reserved.