|
||||||||||
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. |
|
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
|
|
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 |
getLoginTimeout()
|
|
java.io.PrintWriter |
getLogWriter()
|
|
int |
getMaxConnectionCount()
Returns the maximum number of connections of the pool |
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
|
|
void |
release()
Releases the pool by closing all its connections. |
|
void |
setLoginTimeout(int seconds)
|
|
void |
setLogWriter(java.io.PrintWriter out)
|
|
|
unwrap(java.lang.Class<T> iface)
|
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
getConnection
in interface javax.sql.DataSource
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()
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
setLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLoginTimeout(int seconds) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
in interface java.sql.Wrapper
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
in interface java.sql.Wrapper
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |