com.ge.research.utils.db
Interface ConnectionBroker

All Superinterfaces:
javax.sql.DataSource
All Known Implementing Classes:
DDConnectionBrokerWrapper, SingleConnectionManager

public interface ConnectionBroker
extends javax.sql.DataSource

Interface specifing the behavior and functionality required of a connection broker/pooler.

Version:
$Revision: 1.1 $ $Date: 2006/08/11 00:17:26 $
Author:
garbiras
Created on:
Mar 30, 2005

Field Summary
static java.lang.String DB_ATTEMPTS_KEY
          String constant used in database connection property files as the key for the database driver information
static java.lang.String DB_CONNTIMEOUT_KEY
          String constant used in database connection property files as the key for the number of milliseconds to keep pooled connections not in use active and open
static java.lang.String DB_DRIVER_KEY
          String constant used in database connection property files as the key for the database driver information
static java.lang.String DB_MAXCONN_KEY
          String constant used in database connection property files as the key for the maximum connection pool size
static java.lang.String DB_MINCONN_KEY
          String constant used in database connection property files as the key for the minimum connection pool size
static java.lang.String DB_PWD_KEY
          String constant used in database connection property files as the key for the database password information
static java.lang.String DB_URL_KEY
          String constant used in database connection property files as the key for the database url information
static java.lang.String DB_USERNAME_KEY
          String constant used in database connection property files as the key for the database username information
static java.lang.String DB_WAITTIME_KEY
          String constant used in database connection property files as the key for the number of seconds to wait before retrying to obtain a connection from the pool (after a failed attempt)
static int MAX_CONNECTIONS
          The default maximum number of connections to be pooled
static int MIN_CONNECTIONS
          The default maximum number of connections to be pooled
 
Method Summary
 void freeConnection(java.sql.Connection c)
          Returns the connection from use and releases it back tot he pool of available connections which can be accessed by requestors.
 int getMaxConnections()
          Returns the current setting for the maximum allowable size of the connection pool.
 int getMaxDbAttempts()
          Returns the current setting for the maximum number of consecutive attempts at requesting a connection from the pool (without obtaining a free connection), before generating an error.
 int getMinConnections()
          Returns the current setting for the minimum allowable size of the connection pool.
 int getNumberFreeConnections()
          Returns the number of currently free and available connections in the pool
 long getTimeout()
          Returns the current setting for the number of milliseconds to keep pooled connections not in use active and open.
 void setMaxConnections(int i)
          Sets the maximum allowable size of the connection pool.
 void setMaxDbAttempts(int i)
          Sets the maximum number of consecutive attempts allowed when requesting a connection from the pool (without obtaining a free connection), before generating an error.
 void setMinConnections(int i)
          Sets the minimum allowable size of the connection pool.
 void setTimeout(long l)
          Sets the number of milliseconds to keep pooled connections not in use active and open.
 
Methods inherited from interface javax.sql.DataSource
getConnection, getConnection, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 

Field Detail

DB_DRIVER_KEY

public static final java.lang.String DB_DRIVER_KEY
String constant used in database connection property files as the key for the database driver information

See Also:
Constant Field Values

DB_URL_KEY

public static final java.lang.String DB_URL_KEY
String constant used in database connection property files as the key for the database url information

See Also:
Constant Field Values

DB_USERNAME_KEY

public static final java.lang.String DB_USERNAME_KEY
String constant used in database connection property files as the key for the database username information

See Also:
Constant Field Values

DB_PWD_KEY

public static final java.lang.String DB_PWD_KEY
String constant used in database connection property files as the key for the database password information

See Also:
Constant Field Values

DB_MINCONN_KEY

public static final java.lang.String DB_MINCONN_KEY
String constant used in database connection property files as the key for the minimum connection pool size

See Also:
Constant Field Values

DB_MAXCONN_KEY

public static final java.lang.String DB_MAXCONN_KEY
String constant used in database connection property files as the key for the maximum connection pool size

See Also:
Constant Field Values

DB_ATTEMPTS_KEY

public static final java.lang.String DB_ATTEMPTS_KEY
String constant used in database connection property files as the key for the database driver information

See Also:
Constant Field Values

DB_WAITTIME_KEY

public static final java.lang.String DB_WAITTIME_KEY
String constant used in database connection property files as the key for the number of seconds to wait before retrying to obtain a connection from the pool (after a failed attempt)

See Also:
Constant Field Values

DB_CONNTIMEOUT_KEY

public static final java.lang.String DB_CONNTIMEOUT_KEY
String constant used in database connection property files as the key for the number of milliseconds to keep pooled connections not in use active and open

See Also:
Constant Field Values

MAX_CONNECTIONS

public static final int MAX_CONNECTIONS
The default maximum number of connections to be pooled

See Also:
Constant Field Values

MIN_CONNECTIONS

public static final int MIN_CONNECTIONS
The default maximum number of connections to be pooled

See Also:
Constant Field Values
Method Detail

freeConnection

public void freeConnection(java.sql.Connection c)
Returns the connection from use and releases it back tot he pool of available connections which can be accessed by requestors.

Parameters:
c - the connection to return to the available pool

getMaxConnections

public int getMaxConnections()
Returns the current setting for the maximum allowable size of the connection pool.

Returns:
The maximum allowable size of the connection pool

getMaxDbAttempts

public int getMaxDbAttempts()
Returns the current setting for the maximum number of consecutive attempts at requesting a connection from the pool (without obtaining a free connection), before generating an error.

Returns:
The maximum number of attempts to obtain a free connection from the pool

getMinConnections

public int getMinConnections()
Returns the current setting for the minimum allowable size of the connection pool.

Returns:
The minimum allowable size of the connection pool

getTimeout

public long getTimeout()
Returns the current setting for the number of milliseconds to keep pooled connections not in use active and open.

Returns:
The number of milliseconds to keep pooled connections not in use active and open

getNumberFreeConnections

public int getNumberFreeConnections()
Returns the number of currently free and available connections in the pool

Returns:
The number of currently free and available connections in the pool

setMaxConnections

public void setMaxConnections(int i)
Sets the maximum allowable size of the connection pool.

Parameters:
i - the maximum allowable size of the connection pool

setMaxDbAttempts

public void setMaxDbAttempts(int i)
Sets the maximum number of consecutive attempts allowed when requesting a connection from the pool (without obtaining a free connection), before generating an error.

Parameters:
i - the maximum number of attempts to obtain a free connection from the pool

setMinConnections

public void setMinConnections(int i)
Sets the minimum allowable size of the connection pool.

Parameters:
i - the minimum allowable size of the connection pool

setTimeout

public void setTimeout(long l)
Sets the number of milliseconds to keep pooled connections not in use active and open.

Parameters:
l - the number of milliseconds to keep pooled connections not in use active and open