org.apache.commons.dbcp

Class PoolingDriver

Implemented Interfaces:
Driver

public class PoolingDriver
extends Object
implements Driver

A Driver implementation that obtains Connections from a registered ObjectPool.
Version:
$Revision: 500687 $ $Date: 2007-01-27 16:33:47 -0700 (Sat, 27 Jan 2007) $
Authors:
Rodney Waldhoff
Dirk Verbeeck

Constructor Summary

PoolingDriver()

Method Summary

boolean
acceptsURL(String url)
void
closePool(String name)
Connection
connect(String url, Properties info)
ObjectPool
getConnectionPool(String name)
int
getMajorVersion()
int
getMinorVersion()
ObjectPool
getPool(String name)
Deprecated. This will be removed in a future version of DBCP.
String[]
getPoolNames()
DriverPropertyInfo[]
getPropertyInfo(String url, Properties info)
void
invalidateConnection(Connection conn)
Invalidates the given connection.
static boolean
isAccessToUnderlyingConnectionAllowed()
Returns the value of the accessToUnderlyingConnectionAllowed property.
boolean
jdbcCompliant()
void
registerPool(String name, ObjectPool pool)
static void
setAccessToUnderlyingConnectionAllowed(boolean allow)
Sets the value of the accessToUnderlyingConnectionAllowed property.

Constructor Details

PoolingDriver

public PoolingDriver()

Method Details

acceptsURL

public boolean acceptsURL(String url)
            throws SQLException

closePool

public void closePool(String name)
            throws SQLException

connect

public Connection connect(String url,
                          Properties info)
            throws SQLException

getConnectionPool

public ObjectPool getConnectionPool(String name)
            throws SQLException

getMajorVersion

public int getMajorVersion()

getMinorVersion

public int getMinorVersion()

getPool

public ObjectPool getPool(String name)

Deprecated. This will be removed in a future version of DBCP.

WARNING: This method throws DbcpExceptions (RuntimeExceptions) and will be replaced by the protected getConnectionPool method.

getPoolNames

public String[] getPoolNames()
            throws SQLException

getPropertyInfo

public DriverPropertyInfo[] getPropertyInfo(String url,
                                            Properties info)

invalidateConnection

public void invalidateConnection(Connection conn)
            throws SQLException
Invalidates the given connection.
Parameters:
conn - connection to invalidate
Since:
1.2.2

isAccessToUnderlyingConnectionAllowed

public static boolean isAccessToUnderlyingConnectionAllowed()
Returns the value of the accessToUnderlyingConnectionAllowed property.
Returns:
true if access to the underlying is allowed, false otherwise.

jdbcCompliant

public boolean jdbcCompliant()

registerPool

public void registerPool(String name,
                         ObjectPool pool)

setAccessToUnderlyingConnectionAllowed

public static 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.

Copyright © 2001-2004 Apache Software Foundation. Documenation generated June 19 2007.