public class JDBCPoolManager
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private static boolean |
cvActive
A flag indicating if the pools are currently active.
|
private static java.util.Hashtable<java.lang.String,JDBCConnectionPool> |
cvPools
The connection pools for the
JDBCPoolManager . |
private static long |
serialVersionUID
The class' serialization version id.
|
Constructor and Description |
---|
JDBCPoolManager() |
Modifier and Type | Method and Description |
---|---|
private static void |
createPools()
Creates the
JDBCConnectionPool objects. |
static void |
freeConnection(JDBCConnectionInfo cninf)
Returns a JDBC connection info object back to an assumed pool.
|
static void |
freeConnection(java.lang.String name,
JDBCConnectionInfo cninf)
Returns a JDBC connection info object back to the specified pool.
|
static JDBCConnectionInfo |
getConnection()
Retrieves a JDBC connection info object from an assumed pool.
|
static JDBCConnectionInfo |
getConnection(java.lang.String name)
Retrieves a JDBC connection info object from the specified pool.
|
static java.lang.String |
getConnectionConsumers(java.lang.String name)
Returns a sorted list of the connection consumers associated with the
connections currently in-use, suitable for display on a web page (list
is delimited by <br>).
|
static java.lang.String |
getConnectionStats(java.lang.String name)
Returns a string containing information on total number of connections,
number of checked out connections, and number of available ones.
|
static boolean |
hasPools()
Answers if any JDBC connection pools are configured.
|
static boolean |
isActive()
Answers if the set of JDBC connection pools being managed is active.
|
static boolean |
isDB2e(java.lang.String name)
Answers if a connection pool uses an IBM DB2 Everyplace database.
|
static boolean |
isDB2i(java.lang.String name)
Answers if a connection pool uses an IBM DB2 System i (AS/400) database.
|
static boolean |
isDB2w(java.lang.String name)
Answers if a connection pool uses an IBM DB2 Windows database.
|
static boolean |
isDerby(java.lang.String name)
Answers if a connection pool uses an Apache Derby (IBM Cloudscape)
database.
|
private static void |
loadDrivers()
Loads and registers the JDBC drivers.
|
static void |
restart()
Allows the pool to process connections normally.
|
static void |
stopAll()
Shuts down the JDBC connection pools and forces the pool to to refuse
further connections until restarted.
|
private static final long serialVersionUID
private static java.util.Hashtable<java.lang.String,JDBCConnectionPool> cvPools
JDBCPoolManager
.private static boolean cvActive
private static void loadDrivers()
private static void createPools()
JDBCConnectionPool
objects.public static void freeConnection(JDBCConnectionInfo cninf)
cninf
- (JDBCConnectionInfo) The connection info object to return.public static void freeConnection(java.lang.String name, JDBCConnectionInfo cninf)
name
- (String) A connection pool name.cninf
- (JDBCConnectionInfo) The connection info object to return.public static JDBCConnectionInfo getConnection()
public static JDBCConnectionInfo getConnection(java.lang.String name)
name
- (String) A connection pool name.public static java.lang.String getConnectionConsumers(java.lang.String name)
name
- (String) A connection pool name.public static java.lang.String getConnectionStats(java.lang.String name)
name
- (String) A connection pool name.public static boolean hasPools()
true
if pools are configured, otherwise
false
.public static boolean isActive()
true
if the set of pools is active,
otherwise false
.public static boolean isDB2e(java.lang.String name)
name
- (String) A connection pool name.true
if this is a DB2 Everyplace database,
otherwise false
.public static boolean isDB2i(java.lang.String name)
name
- (String) A connection pool name.true
if this is a DB2 System i database,
otherwise false
.public static boolean isDB2w(java.lang.String name)
name
- (String) A connection pool name.true
if this is a DB2 Windows database,
otherwise false
.public static boolean isDerby(java.lang.String name)
name
- (String) A connection pool name.true
if this is an Apache Derby database,
otherwise false
.public static void restart()
public static void stopAll()