public class PoolingDataSource extends Object implements DataSource
Modifier and Type | Field and Description |
---|---|
protected PrintWriter |
_logWriter
My log writer.
|
protected ObjectPool |
_pool |
Constructor and Description |
---|
PoolingDataSource() |
PoolingDataSource(ObjectPool pool) |
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection()
Return a
Connection from my pool,
according to the contract specified by ObjectPool.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 pool) |
<T> T |
unwrap(Class<T> iface) |
protected PrintWriter _logWriter
protected ObjectPool _pool
public PoolingDataSource()
public PoolingDataSource(ObjectPool pool)
public void setPool(ObjectPool 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 Wrapper
SQLException
public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
in interface Wrapper
SQLException
public Connection getConnection() throws SQLException
Connection
from my pool,
according to the contract specified by ObjectPool.borrowObject()
.getConnection
in interface DataSource
SQLException
public Connection getConnection(String uname, String passwd) throws SQLException
getConnection
in interface DataSource
SQLException
public PrintWriter getLogWriter()
getLogWriter
in interface CommonDataSource
CommonDataSource.getLogWriter()
public int getLoginTimeout()
UnsupportedOperationException
.getLoginTimeout
in interface CommonDataSource
UnsupportedOperationException
- As this
implementation does not support this feature.public void setLoginTimeout(int seconds)
UnsupportedOperationException
.setLoginTimeout
in interface CommonDataSource
UnsupportedOperationException
- As this
implementation does not support this feature.public void setLogWriter(PrintWriter out)
setLogWriter
in interface CommonDataSource
CommonDataSource.setLogWriter(java.io.PrintWriter)
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface CommonDataSource
SQLFeatureNotSupportedException
Copyright © 2017. All rights reserved.