Interface ConnectionService
- All Known Implementing Classes:
LuteceConnectionService,ManagedConnectionService,TomcatConnectionService
public interface ConnectionService
Database Connection Service Interface
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidfreeConnection(Connection conn) Release the connectionGet a connectionintGets the number of opened connectionsGet datasourceorg.apache.logging.log4j.LoggerGets the loggerintGets the max connectionsGets the pool nameGets the pool manager providervoidInitialize pool parametersvoidrelease()Free all connectionsvoidsetLogger(org.apache.logging.log4j.Logger logger) Define the loggervoidsetPoolName(String strPoolName) Define the pool name
-
Field Details
-
INFO_NOT_AVAILABLE
static final int INFO_NOT_AVAILABLE- See Also:
-
-
Method Details
-
getConnection
Connection getConnection()Get a connection- Returns:
- A database connection
-
freeConnection
Release the connection- Parameters:
conn- The connection to release
-
release
void release()Free all connections -
init
Initialize pool parameters- Parameters:
htParamsConnectionPool- Parameters
-
setPoolName
Define the pool name- Parameters:
strPoolName- The pool name
-
getPoolName
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
String getPoolProvider()Gets the pool manager provider- Returns:
- The pool manager
-
getDataSource
DataSource getDataSource()Get datasource- Returns:
- A data source object
-