public class PoolingDriver extends Object implements Driver
Modifier and Type | Field and Description |
---|---|
protected static int |
MAJOR_VERSION |
protected static int |
MINOR_VERSION |
protected static HashMap<String,ObjectPool<? extends Connection>> |
pools
The map of registered pools.
|
protected static String |
URL_PREFIX
My URL prefix
|
protected static int |
URL_PREFIX_LEN |
Modifier | Constructor and Description |
---|---|
|
PoolingDriver() |
protected |
PoolingDriver(boolean accessToUnderlyingConnectionAllowed)
For unit testing purposes.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsURL(String url) |
void |
closePool(String name) |
Connection |
connect(String url,
Properties info) |
ObjectPool<? extends Connection> |
getConnectionPool(String name) |
int |
getMajorVersion() |
int |
getMinorVersion() |
Logger |
getParentLogger() |
String[] |
getPoolNames() |
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info) |
void |
invalidateConnection(Connection conn)
Invalidates the given connection.
|
protected boolean |
isAccessToUnderlyingConnectionAllowed()
Returns the value of the accessToUnderlyingConnectionAllowed property.
|
boolean |
jdbcCompliant() |
void |
registerPool(String name,
ObjectPool<? extends Connection> pool) |
protected static final HashMap<String,ObjectPool<? extends Connection>> pools
protected static final String URL_PREFIX
protected static final int URL_PREFIX_LEN
protected static final int MAJOR_VERSION
protected static final int MINOR_VERSION
public PoolingDriver()
protected PoolingDriver(boolean accessToUnderlyingConnectionAllowed)
protected boolean isAccessToUnderlyingConnectionAllowed()
public ObjectPool<? extends Connection> getConnectionPool(String name) throws SQLException
SQLException
public void registerPool(String name, ObjectPool<? extends Connection> pool)
public void closePool(String name) throws SQLException
SQLException
public String[] getPoolNames()
public boolean acceptsURL(String url) throws SQLException
acceptsURL
in interface Driver
SQLException
public Connection connect(String url, Properties info) throws SQLException
connect
in interface Driver
SQLException
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface Driver
SQLFeatureNotSupportedException
public void invalidateConnection(Connection conn) throws SQLException
conn
- connection to invalidateSQLException
- if the connection is not a
PoolGuardConnectionWrapper
or an error occurs invalidating
the connectionpublic int getMajorVersion()
getMajorVersion
in interface Driver
public int getMinorVersion()
getMinorVersion
in interface Driver
public boolean jdbcCompliant()
jdbcCompliant
in interface Driver
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info)
getPropertyInfo
in interface Driver
Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.