Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public final class AOConnectionPool extends AOPool<Connection,SQLException,SQLException>
Thread.State, Thread.UncaughtExceptionHandlerDEFAULT_CONNECT_TIMEOUT, DEFAULT_DELAY_TIME, DEFAULT_MAX_CONNECTION_AGE, DEFAULT_MAX_IDLE_TIME, DEFAULT_SOCKET_SO_LINGER, logger, UNLIMITED_MAX_CONNECTION_AGEMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
AOConnectionPool(String driver,
String url,
String user,
String password,
int numConnections,
long maxConnectionAge,
Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
close(Connection conn) |
Connection |
getConnection()
Gets a read/write connection to the database with a transaction level of Connection.TRANSACTION_READ_COMMITTED and a maximum connections of 1.
|
Connection |
getConnection(boolean readOnly)
Gets a connection to the database with a transaction level of Connection.TRANSACTION_READ_COMMITTED and a maximum connections of 1.
|
Connection |
getConnection(int isolationLevel,
boolean readOnly)
Gets a connection to the database with a maximum connections of 1.
|
Connection |
getConnection(int isolationLevel,
boolean readOnly,
int maxConnections) |
protected Connection |
getConnectionObject()
Creates a new connection.
|
protected boolean |
isClosed(Connection conn) |
protected SQLException |
newException(String message,
Throwable cause) |
protected SQLException |
newInterruptedException(String message,
Throwable cause) |
protected void |
printConnectionStats(Appendable out)
Prints additional connection pool details.
|
protected void |
resetConnection(Connection conn) |
String |
toString() |
close, getConcurrency, getConnection, getConnectionCount, getConnects, getLogger, getMaxConcurrency, getMaxConnectionAge, getPoolSize, getTotalTime, getTransactionCount, printStatisticsHTML, releaseConnection, runactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yieldprotected void close(Connection conn) throws SQLException
close in class AOPool<Connection,SQLException,SQLException>SQLExceptionpublic Connection getConnection() throws SQLException
getConnection in class AOPool<Connection,SQLException,SQLException>SQLExceptionAOPool.getConnection(int)public Connection getConnection(boolean readOnly) throws SQLException
readOnly - SQLExceptionpublic Connection getConnection(int isolationLevel, boolean readOnly) throws SQLException
isolationLevel - readOnly - SQLExceptionpublic Connection getConnection(int isolationLevel, boolean readOnly, int maxConnections) throws SQLException
SQLExceptionprotected Connection getConnectionObject() throws SQLException
AOPoolgetConnectionObject in class AOPool<Connection,SQLException,SQLException>SQLExceptionprotected boolean isClosed(Connection conn) throws SQLException
isClosed in class AOPool<Connection,SQLException,SQLException>SQLExceptionprotected void printConnectionStats(Appendable out) throws IOException
AOPoolprintConnectionStats in class AOPool<Connection,SQLException,SQLException>IOExceptionprotected void resetConnection(Connection conn) throws SQLException
resetConnection in class AOPool<Connection,SQLException,SQLException>SQLExceptionprotected SQLException newException(String message, Throwable cause)
newException in class AOPool<Connection,SQLException,SQLException>protected SQLException newInterruptedException(String message, Throwable cause)
newInterruptedException in class AOPool<Connection,SQLException,SQLException>Copyright © 2000–2016 AO Industries, Inc.. All rights reserved.