|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ge.research.utils.db.DDConnectionBrokerWrapper
DOCUMENT ME!
| Field Summary |
| Fields inherited from interface com.ge.research.utils.db.ConnectionBroker |
DB_ATTEMPTS_KEY, DB_CONNTIMEOUT_KEY, DB_DRIVER_KEY, DB_MAXCONN_KEY, DB_MINCONN_KEY, DB_PWD_KEY, DB_URL_KEY, DB_USERNAME_KEY, DB_WAITTIME_KEY, MAX_CONNECTIONS, MIN_CONNECTIONS |
| Constructor Summary | |
DDConnectionBrokerWrapper(java.lang.String resourceFile)
Default Constructor. |
|
DDConnectionBrokerWrapper(java.lang.String driver,
java.lang.String url,
java.lang.String username,
java.lang.String password,
int minConnections,
int maxConnections,
long timeout,
long leaseTime,
java.lang.String logFile)
Creates a DDConnectionBroker pool manager
from the argument information. |
|
| Method Summary | |
java.lang.Object |
clone()
Creates a copy of the connection broker, with the current settings for pooling variables. |
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. |
java.sql.Connection |
getConnection()
|
java.sql.Connection |
getConnection(java.lang.String user,
java.lang.String password)
|
java.lang.String |
getDriver()
Returns the current setting of the database connection driver. |
long |
getLeaseTime()
Returns the current setting of the connection lease time. |
java.lang.String |
getLogFile()
Returns the current setting of the log file to use for writing out pooling messages. |
int |
getLoginTimeout()
|
java.io.PrintWriter |
getLogWriter()
|
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 |
java.lang.String |
getPassword()
Returns the current setting of the database connection password. |
long |
getTimeout()
Returns the current setting for the number of milliseconds to keep pooled connections not in use active and open. |
java.lang.String |
getUrl()
Returns the current setting of the database connection url. |
java.lang.String |
getUsername()
Returns the current setting of the database connection username. |
void |
setDriver(java.lang.String string)
Sets the database driver to use to connect to the database. |
void |
setLeaseTime(long l)
Sets the connection lease time limit. |
void |
setLogFile(java.lang.String string)
Sets the log file to use for writing out pooling messages. |
void |
setLoginTimeout(int i)
|
void |
setLogWriter(java.io.PrintWriter out)
|
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 |
setPassword(java.lang.String string)
Sets the database password to use to connect to the database. |
void |
setTimeout(long l)
Sets the number of milliseconds to keep pooled connections not in use active and open. |
void |
setUrl(java.lang.String string)
Sets the database url to use to connect to the database. |
void |
setUsername(java.lang.String string)
Sets the database username to use to connect to the database. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DDConnectionBrokerWrapper(java.lang.String resourceFile)
throws java.sql.SQLException,
java.lang.Exception
DDConnectionBroker pool manager.
resourceFile - the resource bundle name
java.lang.Exception - If the resource bundle information could not be loaded.
java.sql.SQLException - If the DDConnectionBroker could not be created.
public DDConnectionBrokerWrapper(java.lang.String driver,
java.lang.String url,
java.lang.String username,
java.lang.String password,
int minConnections,
int maxConnections,
long timeout,
long leaseTime,
java.lang.String logFile)
throws java.sql.SQLException
DDConnectionBroker pool manager
from the argument information.
driver - the database driver class to use to connect to the databaseurl - the database url to use to connect to the databaseusername - the database username authentication to use to connect to the databasepassword - the database password authentication to use to connect to the databaseminConnections - the minimum sie of the connection poolmaxConnections - the maximum size of the connection pooltimeout - the connection timeout interval in millisecondsleaseTime - the connection lease length in millisecondslogFile - the logfile to use when writing out pooling messages
java.sql.SQLException - If the DDConnectionBroker could not be created.| Method Detail |
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLException
public java.sql.Connection getConnection(java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLExceptionpublic void setDriver(java.lang.String string)
string - the database driver to use to connect to the databasepublic java.lang.String getDriver()
public void setUrl(java.lang.String string)
string - the database url to use to connect to the databasepublic java.lang.String getUrl()
public void setUsername(java.lang.String string)
string - the database username to use to connect to the databasepublic java.lang.String getUsername()
public void setPassword(java.lang.String string)
string - the database password to use to connect to the databasepublic java.lang.String getPassword()
public void setLeaseTime(long l)
l - the connection lease timepublic long getLeaseTime()
public void setLogFile(java.lang.String string)
string - the log file to use for writing out pooling messagespublic java.lang.String getLogFile()
public void setLogWriter(java.io.PrintWriter out)
setLogWriter in interface javax.sql.DataSourcepublic java.io.PrintWriter getLogWriter()
getLogWriter in interface javax.sql.DataSourcepublic void setLoginTimeout(int i)
setLoginTimeout in interface javax.sql.DataSourcepublic int getLoginTimeout()
getLoginTimeout in interface javax.sql.DataSourcepublic void setMaxConnections(int i)
ConnectionBroker
setMaxConnections in interface ConnectionBrokeri - the maximum allowable size of the connection poolpublic int getMaxConnections()
ConnectionBroker
getMaxConnections in interface ConnectionBrokerpublic void setMaxDbAttempts(int i)
ConnectionBroker
setMaxDbAttempts in interface ConnectionBrokeri - the maximum number of attempts to obtain a free connection from the poolpublic int getMaxDbAttempts()
ConnectionBroker
getMaxDbAttempts in interface ConnectionBrokerpublic void setMinConnections(int i)
ConnectionBroker
setMinConnections in interface ConnectionBrokeri - the minimum allowable size of the connection poolpublic int getMinConnections()
ConnectionBroker
getMinConnections in interface ConnectionBrokerpublic java.lang.Object clone()
null if a new connection
broker could not be instantiated.public void setTimeout(long l)
ConnectionBroker
setTimeout in interface ConnectionBrokerl - the number of milliseconds to keep pooled connections not in use active and openpublic long getTimeout()
ConnectionBroker
getTimeout in interface ConnectionBrokerpublic void freeConnection(java.sql.Connection c)
ConnectionBroker
freeConnection in interface ConnectionBrokerc - the connection to return to the available poolpublic int getNumberFreeConnections()
ConnectionBroker
getNumberFreeConnections in interface ConnectionBroker
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||