org.apache.commons.dbcp

Class PoolingDataSource

public class PoolingDataSource extends Object implements DataSource

A simple {@link DataSource} implementation that obtains {@link Connection}s from the specified {@link 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 {@link java.sql.Connection} from my pool, according to the contract specified by {@link ObjectPool#borrowObject}.
ConnectiongetConnection(String uname, String passwd)
Throws {@link UnsupportedOperationException}
intgetLoginTimeout()
Throws {@link 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 {@link 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 {@link java.sql.Connection} from my pool, according to the contract specified by {@link ObjectPool#borrowObject}.

getConnection

public Connection getConnection(String uname, String passwd)
Throws {@link UnsupportedOperationException}

Throws: UnsupportedOperationException

getLoginTimeout

public int getLoginTimeout()
Throws {@link UnsupportedOperationException}. Do this configuration within my {@link 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 {@link UnsupportedOperationException}. Do this configuration within my {@link 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 April 25 2007.