org.dbforms.conprovider
Class ProtomatterConnectionProvider

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

public class ProtomatterConnectionProvider
extends AbstractConnectionProvider

Connection provider for Protomatter Connection pool.
See http://protomatter.sourceforge.net/ for further informations.

Author:
Luca Fossato

Field Summary
protected static String CP_PROPS_CREATEWAITTIME
          the time (in ms) to sleep between pool object creates (default is 0).
protected static String CP_PROPS_GROWBLOCK
          the grow size (default is 1).
protected static String CP_PROPS_INITIALSIZE
          the initial pool size (default is 0)
protected static String CP_PROPS_MAIDTHREADCHECKINTERVAL
          this is the number of seconds between attempts by the maid thread (if present) to find idle connections.
protected static String CP_PROPS_MAXCONNECTIONIDLETIME
          If this property is present, and the pool.maidThreadCheckInterval property is also present, then a thread will be created that looks for connections that have been idle for more than pool.maxConnectionIdleTime seconds.
protected static String CP_PROPS_MAXSIZE
          the max pool size (default is -1).
protected static String CP_PROPS_VALIDITYCHECKSTATEMENT
          A SQL statement that is guaranteed to return at least 1 row.
 
Constructor Summary
ProtomatterConnectionProvider()
          Default constructor.
 
Method Summary
protected  Connection getConnection()
          Get a JDBC Connection
protected  void init()
          Initialize the Protomatter 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_INITIALSIZE

protected static final String CP_PROPS_INITIALSIZE
the initial pool size (default is 0)

See Also:
Constant Field Values

CP_PROPS_MAXSIZE

protected static final String CP_PROPS_MAXSIZE
the max pool size (default is -1). If the max pool size is -1, the pool grows infinitely.

See Also:
Constant Field Values

CP_PROPS_GROWBLOCK

protected static final String CP_PROPS_GROWBLOCK
the grow size (default is 1). When a new object is needed, this many are created.

See Also:
Constant Field Values

CP_PROPS_CREATEWAITTIME

protected static final String CP_PROPS_CREATEWAITTIME
the time (in ms) to sleep between pool object creates (default is 0). This is useful for database connection pools where it's possible to overload the database by trying to make too many connections too quickly.

See Also:
Constant Field Values

CP_PROPS_VALIDITYCHECKSTATEMENT

protected static final String CP_PROPS_VALIDITYCHECKSTATEMENT
A SQL statement that is guaranteed to return at least 1 row. For Oracle, this is "select 1 from dual" and for Sybase it is "select 1". This statement is used as a means of checking that a connection is indeed working.

See Also:
Constant Field Values

CP_PROPS_MAXCONNECTIONIDLETIME

protected static final String CP_PROPS_MAXCONNECTIONIDLETIME
If this property is present, and the pool.maidThreadCheckInterval property is also present, then a thread will be created that looks for connections that have been idle for more than pool.maxConnectionIdleTime seconds. When this thread finds them, it closed the connection and logs a warning with a stack trace of when the connection was checked out of the pool. This is primarily here as a debugging aid for finding places where connections are not getting close, and should not be used in a production environment

See Also:
Constant Field Values

CP_PROPS_MAIDTHREADCHECKINTERVAL

protected static final String CP_PROPS_MAIDTHREADCHECKINTERVAL
this is the number of seconds between attempts by the maid thread (if present) to find idle connections.

See Also:
Constant Field Values
Constructor Detail

ProtomatterConnectionProvider

public ProtomatterConnectionProvider()
                              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 Protomatter connection pool.

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


Copyright © 2002-2006 DbForms. All Rights Reserved.