public abstract class ManagedDataSource extends Object implements DataSource
| Modifier and Type | Class and Description |
|---|---|
protected class |
ManagedDataSource.NoPoolConnectionEventListener |
| Modifier | Constructor and Description |
|---|---|
protected |
ManagedDataSource(int maxConnections,
io.airlift.units.Duration maxConnectionWait) |
protected ManagedDataSource(int maxConnections,
io.airlift.units.Duration maxConnectionWait)
public Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionprotected Connection createConnection() throws SQLException
SQLExceptionprotected abstract PooledConnection createConnectionInternal() throws SQLException
SQLExceptionprotected Connection prepareConnection(PooledConnection pooledConnection) throws SQLException
SQLExceptionprotected void connectionReturned(PooledConnection pooledConnection, long checkoutTime)
protected void connectionDestroyed(PooledConnection pooledConnection, long checkoutTime)
public int getMaxConnectionWaitMillis()
public void setMaxConnectionWaitMillis(io.airlift.units.Duration maxConnectionWait)
throws IllegalArgumentException
IllegalArgumentExceptionpublic long getConnectionsActive()
public int getMaxConnections()
public void setMaxConnections(int maxConnections)
public ManagedDataSourceStats getStats()
public PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic final Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceUnsupportedOperationException - alwaysSQLExceptionCopyright © 2010–2019 Airlift. All rights reserved.