org.apache.commons.dbcp
Class PoolingDataSource
- DataSource
public class PoolingDataSource
implements DataSource
A simple DataSource
implementation that obtains
Connection
s from the specified ObjectPool
.
$Revision: 1.13 $ $Date: 2004/02/28 12:18:17 $- Rodney Waldhoff
- Glenn L. Nielsen
- James House
- Dirk Verbeeck
PoolingDataSource
public PoolingDataSource()
PoolingDataSource
public PoolingDataSource(ObjectPool pool)
getConnection
public Connection getConnection()
throws SQLException
Return a
Connection
from my pool,
according to the contract specified by
ObjectPool.borrowObject
.
getConnection
public Connection getConnection(String uname,
String passwd)
throws SQLException
Throws UnsupportedOperationException
getLogWriter
public PrintWriter getLogWriter()
Returns my log writer.
getLoginTimeout
public int getLoginTimeout()
Throws UnsupportedOperationException
.
Do this configuration within my ObjectPool
.
isAccessToUnderlyingConnectionAllowed
public boolean isAccessToUnderlyingConnectionAllowed()
Returns the value of the accessToUnderlyingConnectionAllowed property.
- true if access to the underlying is allowed, false otherwise.
setAccessToUnderlyingConnectionAllowed
public void setAccessToUnderlyingConnectionAllowed(boolean allow)
Sets the value of the accessToUnderlyingConnectionAllowed property.
It controls if the PoolGuard allows access to the underlying connection.
(Default: false)
allow
- Access to the underlying connection is granted when true.
setLogWriter
public void setLogWriter(PrintWriter out)
Sets my log writer.
setLoginTimeout
public void setLoginTimeout(int seconds)
Throws UnsupportedOperationException
.
Do this configuration within my ObjectPool
.
setPool
public void setPool(ObjectPool pool)
throws IllegalStateException,
NullPointerException
Copyright © 2001-2003 Apache Software Foundation. Documenation generated January 16 2006.