Package org.opencms.db
Class CmsSqlManager
java.lang.Object
org.opencms.db.CmsSqlManager
- Direct Known Subclasses:
CmsSqlManager
Superclass for all SQL manager implementations.
- Since:
- 6.0.0
-
Constructor Summary
ModifierConstructorDescriptionprotected
Protected constructor to allow only subclassing.protected
CmsSqlManager
(CmsDriverManager driverManager) Creates a new SQL manager from the provided driver manager. -
Method Summary
Modifier and TypeMethodDescriptionint
getActiveConnections
(String dbPoolUrl) Returns the number of active connections managed by a pool.getConnection
(String dbPoolName) Returns a connection to the database using the given pool identified by its name.getConnectionByUrl
(String dbPoolUrl) Returns a connection to the database using the given pool identified by its full url.Returns a list of available database connection pool names.Returns the name of the default database connection pool.int
getIdleConnections
(String dbPoolUrl) Returns the number of idle connections managed by a pool.
-
Constructor Details
-
CmsSqlManager
protected CmsSqlManager()Protected constructor to allow only subclassing. -
CmsSqlManager
Creates a new SQL manager from the provided driver manager.- Parameters:
driverManager
- the low level database driver manager
-
-
Method Details
-
getActiveConnections
Returns the number of active connections managed by a pool.- Parameters:
dbPoolUrl
- the url of a pool- Returns:
- the number of active connections
- Throws:
CmsDbException
- if something goes wrong
-
getConnection
Returns a connection to the database using the given pool identified by its name.- Parameters:
dbPoolName
- the pool name- Returns:
- a database connection
- Throws:
SQLException
- if something goes wrong
-
getConnectionByUrl
Returns a connection to the database using the given pool identified by its full url.- Parameters:
dbPoolUrl
- the pool url- Returns:
- a database connection
- Throws:
SQLException
- if something goes wrong
-
getDbPoolUrls
Returns a list of available database connection pool names.- Returns:
- a list of database connection pool names
-
getDefaultDbPoolName
Returns the name of the default database connection pool.- Returns:
- the name of the default database connection pool
-
getIdleConnections
Returns the number of idle connections managed by a pool.- Parameters:
dbPoolUrl
- the url of a pool- Returns:
- the number of idle connections
- Throws:
CmsDbException
- if something goes wrong
-