org.apache.commons.dbcp

Class PoolingDataSource

public class PoolingDataSource extends Object implements DataSource

A simple DataSource implementation that obtains Connections from the specified ObjectPool.

Version: $Revision: 1.13 $ $Date: 2004/02/28 12:18:17 $

Author: Rodney Waldhoff Glenn L. Nielsen James House Dirk Verbeeck

Constructor Summary
PoolingDataSource()
PoolingDataSource(ObjectPool pool)
Method Summary
ConnectiongetConnection()
Return a java.sql.Connection from my pool, according to the contract specified by ObjectPool#borrowObject.
ConnectiongetConnection(String uname, String passwd)
Throws
intgetLoginTimeout()
Throws UnsupportedOperationException.
PrintWritergetLogWriter()
Returns my log writer.
booleanisAccessToUnderlyingConnectionAllowed()
Returns the value of the accessToUnderlyingConnectionAllowed property.
voidsetAccessToUnderlyingConnectionAllowed(boolean allow)
Sets the value of the accessToUnderlyingConnectionAllowed property.
voidsetLoginTimeout(int seconds)
Throws UnsupportedOperationException.
voidsetLogWriter(PrintWriter out)
Sets my log writer.
voidsetPool(ObjectPool pool)

Constructor Detail

PoolingDataSource

public PoolingDataSource()

PoolingDataSource

public PoolingDataSource(ObjectPool pool)

Method Detail

getConnection

public Connection getConnection()
Return a java.sql.Connection from my pool, according to the contract specified by ObjectPool#borrowObject.

getConnection

public Connection getConnection(String uname, String passwd)
Throws UnsupportedOperationException

Throws: UnsupportedOperationException

getLoginTimeout

public int getLoginTimeout()
Throws UnsupportedOperationException. Do this configuration within my ObjectPool.

Throws: UnsupportedOperationException

getLogWriter

public PrintWriter getLogWriter()
Returns my log writer.

Returns: my log writer

See Also: DataSource#getLogWriter

isAccessToUnderlyingConnectionAllowed

public boolean isAccessToUnderlyingConnectionAllowed()
Returns the value of the accessToUnderlyingConnectionAllowed property.

Returns: 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)

Parameters: allow Access to the underlying connection is granted when true.

setLoginTimeout

public void setLoginTimeout(int seconds)
Throws UnsupportedOperationException. Do this configuration within my ObjectPool.

Throws: UnsupportedOperationException

setLogWriter

public void setLogWriter(PrintWriter out)
Sets my log writer.

See Also: DataSource#setLogWriter

setPool

public void setPool(ObjectPool pool)
Copyright © 2001-2003 Apache Software Foundation. Documenation generated February 19 2008.