public class PoolingDataSource<C extends Connection> extends Object implements DataSource
| Modifier and Type | Field and Description | 
|---|---|
| protected PrintWriter | _logWriterMy log writer. | 
| protected ObjectPool<C> | _pool | 
| Constructor and Description | 
|---|
| PoolingDataSource() | 
| PoolingDataSource(ObjectPool<C> pool) | 
| Modifier and Type | Method and Description | 
|---|---|
| Connection | getConnection()Return a  Connectionfrom my pool,
 according to the contract specified byObjectPool.borrowObject(). | 
| Connection | getConnection(String uname,
             String passwd) | 
| int | getLoginTimeout()Throws  UnsupportedOperationException. | 
| PrintWriter | getLogWriter()Returns my log writer. | 
| Logger | getParentLogger() | 
| boolean | isAccessToUnderlyingConnectionAllowed()Returns the value of the accessToUnderlyingConnectionAllowed property. | 
| boolean | isWrapperFor(Class<?> iface) | 
| void | setAccessToUnderlyingConnectionAllowed(boolean allow)Sets the value of the accessToUnderlyingConnectionAllowed property. | 
| void | setLoginTimeout(int seconds)Throws  UnsupportedOperationException. | 
| void | setLogWriter(PrintWriter out)Sets my log writer. | 
| void | setPool(ObjectPool<C> pool) | 
| <T> T | unwrap(Class<T> iface) | 
protected PrintWriter _logWriter
protected ObjectPool<C extends Connection> _pool
public PoolingDataSource()
public PoolingDataSource(ObjectPool<C> pool)
public void setPool(ObjectPool<C> pool) throws IllegalStateException, NullPointerException
public boolean isAccessToUnderlyingConnectionAllowed()
public void setAccessToUnderlyingConnectionAllowed(boolean allow)
allow - Access to the underlying connection is granted when true.public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionpublic Connection getConnection() throws SQLException
Connection from my pool,
 according to the contract specified by ObjectPool.borrowObject().getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String uname, String passwd) throws SQLException
getConnection in interface DataSourceUnsupportedOperationExceptionSQLExceptionpublic PrintWriter getLogWriter()
getLogWriter in interface CommonDataSourceCommonDataSource.getLogWriter()public int getLoginTimeout()
UnsupportedOperationException.getLoginTimeout in interface CommonDataSourceUnsupportedOperationException - As this
   implementation does not support this feature.public void setLoginTimeout(int seconds)
UnsupportedOperationException.setLoginTimeout in interface CommonDataSourceUnsupportedOperationException - As this
   implementation does not support this feature.public void setLogWriter(PrintWriter out)
setLogWriter in interface CommonDataSourceCommonDataSource.setLogWriter(java.io.PrintWriter)Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.