Package org.apache.tomcat.dbcp.dbcp2
Class PoolingDriver
java.lang.Object
org.apache.tomcat.dbcp.dbcp2.PoolingDriver
- All Implemented Interfaces:
- Driver
- Since:
- 2.0
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final HashMap<String,ObjectPool<? extends Connection>> The map of registered pools.static final StringMy URL prefixprotected static final int
- 
Constructor SummaryConstructorsModifierConstructorDescriptionConstructs a new driver withaccessToUnderlyingConnectionAllowedenabled.protectedPoolingDriver(boolean accessToUnderlyingConnectionAllowed) For unit testing purposes.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanacceptsURL(String url) voidCloses a named pool.connect(String url, Properties info) ObjectPool<? extends Connection>getConnectionPool(String name) Gets the connection pool for the given name.intintString[]Gets the pool names.getPropertyInfo(String url, Properties info) voidInvalidates the given connection.protected booleanReturns the value of the accessToUnderlyingConnectionAllowed property.booleanvoidregisterPool(String name, ObjectPool<? extends Connection> pool) Registers a named pool.
- 
Field Details- 
poolsThe map of registered pools.
- 
URL_PREFIXMy URL prefix- See Also:
 
- 
URL_PREFIX_LENprotected static final int URL_PREFIX_LEN
- 
MAJOR_VERSIONprotected static final int MAJOR_VERSION- See Also:
 
- 
MINOR_VERSIONprotected static final int MINOR_VERSION- See Also:
 
 
- 
- 
Constructor Details- 
PoolingDriverpublic PoolingDriver()Constructs a new driver withaccessToUnderlyingConnectionAllowedenabled.
- 
PoolingDriverprotected PoolingDriver(boolean accessToUnderlyingConnectionAllowed) For unit testing purposes.- Parameters:
- accessToUnderlyingConnectionAllowed- Do- DelegatingConnections created by this driver permit access to the delegate?
 
 
- 
- 
Method Details- 
acceptsURL- Specified by:
- acceptsURLin interface- Driver
- Throws:
- SQLException
 
- 
closePoolCloses a named pool.- Parameters:
- name- The pool name.
- Throws:
- SQLException- Thrown when a problem is caught closing the pool.
 
- 
connect- Specified by:
- connectin interface- Driver
- Throws:
- SQLException
 
- 
getConnectionPoolGets the connection pool for the given name.- Parameters:
- name- The pool name
- Returns:
- The pool
- Throws:
- SQLException- Thrown when the named pool is not registered.
 
- 
getMajorVersionpublic int getMajorVersion()- Specified by:
- getMajorVersionin interface- Driver
 
- 
getMinorVersionpublic int getMinorVersion()- Specified by:
- getMinorVersionin interface- Driver
 
- 
getParentLogger- Specified by:
- getParentLoggerin interface- Driver
- Throws:
- SQLFeatureNotSupportedException
 
- 
getPoolNamesGets the pool names.- Returns:
- the pool names.
 
- 
getPropertyInfo- Specified by:
- getPropertyInfoin interface- Driver
 
- 
invalidateConnectionInvalidates the given connection.- Parameters:
- conn- connection to invalidate
- Throws:
- SQLException- if the connection is not a- PoolGuardConnectionWrapperor an error occurs invalidating the connection
 
- 
isAccessToUnderlyingConnectionAllowedprotected boolean isAccessToUnderlyingConnectionAllowed()Returns the value of the accessToUnderlyingConnectionAllowed property.- Returns:
- true if access to the underlying is allowed, false otherwise.
 
- 
jdbcCompliantpublic boolean jdbcCompliant()- Specified by:
- jdbcCompliantin interface- Driver
 
- 
registerPoolRegisters a named pool.- Parameters:
- name- The pool name.
- pool- The pool.
 
 
-