public class PoolingDataSource
extends java.lang.Object
implements javax.sql.DataSource
DataSource implementation that obtains
Connections from the specified ObjectPool.| Constructor and Description |
|---|
PoolingDataSource() |
PoolingDataSource(org.apache.commons.pool.ObjectPool pool) |
| Modifier and Type | Method and Description |
|---|---|
java.sql.Connection |
getConnection()
Return a
Connection from my pool,
according to the contract specified by ObjectPool.borrowObject(). |
java.sql.Connection |
getConnection(java.lang.String uname,
java.lang.String passwd)
Throws
UnsupportedOperationException |
int |
getLoginTimeout()
Throws
UnsupportedOperationException. |
java.io.PrintWriter |
getLogWriter()
Returns my log writer.
|
java.util.logging.Logger |
getParentLogger() |
boolean |
isAccessToUnderlyingConnectionAllowed()
Returns the value of the accessToUnderlyingConnectionAllowed property.
|
boolean |
isWrapperFor(java.lang.Class<?> iface) |
void |
setAccessToUnderlyingConnectionAllowed(boolean allow)
Sets the value of the accessToUnderlyingConnectionAllowed property.
|
void |
setLoginTimeout(int seconds)
Throws
UnsupportedOperationException. |
void |
setLogWriter(java.io.PrintWriter out)
Sets my log writer.
|
void |
setPool(org.apache.commons.pool.ObjectPool pool) |
<T> T |
unwrap(java.lang.Class<T> iface) |
public PoolingDataSource()
public PoolingDataSource(org.apache.commons.pool.ObjectPool pool)
public java.sql.Connection getConnection()
throws java.sql.SQLException
Connection from my pool,
according to the contract specified by ObjectPool.borrowObject().getConnection in interface javax.sql.DataSourcejava.sql.SQLExceptionpublic java.sql.Connection getConnection(java.lang.String uname,
java.lang.String passwd)
throws java.sql.SQLException
UnsupportedOperationExceptiongetConnection in interface javax.sql.DataSourcejava.lang.UnsupportedOperationExceptionjava.sql.SQLExceptionpublic int getLoginTimeout()
UnsupportedOperationException.
Do this configuration within my ObjectPool.getLoginTimeout in interface javax.sql.CommonDataSourcejava.lang.UnsupportedOperationExceptionpublic java.io.PrintWriter getLogWriter()
getLogWriter in interface javax.sql.CommonDataSourceCommonDataSource.getLogWriter()public java.util.logging.Logger getParentLogger()
throws java.sql.SQLFeatureNotSupportedException
getParentLogger in interface javax.sql.CommonDataSourcejava.sql.SQLFeatureNotSupportedExceptionpublic boolean isAccessToUnderlyingConnectionAllowed()
public boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLExceptionpublic void setAccessToUnderlyingConnectionAllowed(boolean allow)
allow - Access to the underlying connection is granted when true.public void setLoginTimeout(int seconds)
UnsupportedOperationException.
Do this configuration within my ObjectPool.setLoginTimeout in interface javax.sql.CommonDataSourcejava.lang.UnsupportedOperationExceptionpublic void setLogWriter(java.io.PrintWriter out)
setLogWriter in interface javax.sql.CommonDataSourceCommonDataSource.setLogWriter(java.io.PrintWriter)public void setPool(org.apache.commons.pool.ObjectPool pool)
throws java.lang.IllegalStateException,
java.lang.NullPointerException
java.lang.IllegalStateExceptionjava.lang.NullPointerExceptionpublic <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLExceptionCopyright © 2001-2003 Apache Software Foundation. Documenation generated May 14 2016.