Interface ConnectionService
-
- All Known Implementing Classes:
C3p0ConnectionService,LuteceConnectionService,TomcatConnectionService
public interface ConnectionServiceDatabase Connection Service Interface
-
-
Field Summary
Fields Modifier and Type Field Description static intINFO_NOT_AVAILABLE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfreeConnection(java.sql.Connection conn)Release the connectionjava.sql.ConnectiongetConnection()Get a connectionintgetCurrentConnections()Gets the number of opened connectionsjavax.sql.DataSourcegetDataSource()Get datasourceorg.apache.logging.log4j.LoggergetLogger()Gets the loggerintgetMaxConnections()Gets the max connectionsjava.lang.StringgetPoolName()Gets the pool namejava.lang.StringgetPoolProvider()Gets the pool manager providervoidinit(java.util.Map<java.lang.String,java.lang.String> htParamsConnectionPool)Initialize pool parametersvoidrelease()Free all connectionsvoidsetLogger(org.apache.logging.log4j.Logger logger)Define the loggervoidsetPoolName(java.lang.String strPoolName)Define the pool name
-
-
-
Field Detail
-
INFO_NOT_AVAILABLE
static final int INFO_NOT_AVAILABLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getConnection
java.sql.Connection getConnection()
Get a connection- Returns:
- A database connection
-
freeConnection
void freeConnection(java.sql.Connection conn)
Release the connection- Parameters:
conn- The connection to release
-
release
void release()
Free all connections
-
init
void init(java.util.Map<java.lang.String,java.lang.String> htParamsConnectionPool)
Initialize pool parameters- Parameters:
htParamsConnectionPool- Parameters
-
setPoolName
void setPoolName(java.lang.String strPoolName)
Define the pool name- Parameters:
strPoolName- The pool name
-
getPoolName
java.lang.String getPoolName()
Gets the pool name- Returns:
- The pool name
-
setLogger
void setLogger(org.apache.logging.log4j.Logger logger)
Define the logger- Parameters:
logger- The logger
-
getLogger
org.apache.logging.log4j.Logger getLogger()
Gets the logger- Returns:
- The logger
-
getCurrentConnections
int getCurrentConnections()
Gets the number of opened connections- Returns:
- The current connections count
-
getMaxConnections
int getMaxConnections()
Gets the max connections- Returns:
- The max connections count
-
getPoolProvider
java.lang.String getPoolProvider()
Gets the pool manager provider- Returns:
- The pool manager
-
getDataSource
javax.sql.DataSource getDataSource()
Get datasource- Returns:
- A data source object
-
-