|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.util.pool.service.ConnectionPool
public class ConnectionPool
This class manages a database connection pool.
Constructor Summary | |
---|---|
ConnectionPool(java.lang.String strName,
java.lang.String strUrl,
java.lang.String strUser,
java.lang.String strPassword,
int nMaxConns,
int nInitConns,
int nTimeOut,
org.apache.log4j.Logger logger,
java.lang.String strCheckValidConnectionSql)
Constructor |
Method Summary | |
---|---|
void |
freeConnection(java.sql.Connection conn)
Returns a connection to pool. |
int |
getBusyConnectionCount()
Returns the number of busy connections of the pool (available or busy) |
java.sql.Connection |
getConnection()
Returns a connection from the pool. |
int |
getConnectionCount()
Returns the number of connections opened by the pool (available or busy) |
int |
getFreeConnectionCount()
Returns the number of free connections of the pool (available or busy) |
int |
getMaxConnectionCount()
Returns the maximum number of connections of the pool |
void |
release()
Releases the pool by closing all its connections. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectionPool(java.lang.String strName, java.lang.String strUrl, java.lang.String strUser, java.lang.String strPassword, int nMaxConns, int nInitConns, int nTimeOut, org.apache.log4j.Logger logger, java.lang.String strCheckValidConnectionSql)
strName
- Nom du poolstrUrl
- JDBC Data source URLstrUser
- SQL UserstrPassword
- SQL PasswordnMaxConns
- Max connectionsnInitConns
- Initials connectionsnTimeOut
- Timeout to get a connectionlogger
- the Logger objectstrCheckValidConnectionSql
- The SQL syntax used for check connexion validatationMethod Detail |
---|
public java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.SQLException
- The SQL exceptionpublic void freeConnection(java.sql.Connection conn)
conn
- The released connection to return to poolpublic void release()
public int getConnectionCount()
public int getFreeConnectionCount()
public int getBusyConnectionCount()
public int getMaxConnectionCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |