public class SingleConnectionCachingFactory extends Object implements CachingConnectionFactory
Not thread safe.
| Constructor and Description |
|---|
SingleConnectionCachingFactory(ConnectionFactory delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnections()
Closes all open connections in this factory's cache.
|
Connection |
getConnection(ConnectionInfo info)
Gets an open
Connection based on given connection parameters. |
public SingleConnectionCachingFactory(ConnectionFactory delegate)
public Connection getConnection(ConnectionInfo info) throws SQLException
Connection based on given connection parameters.
For this implementation, calls to createConnection without any
intervening calls to closeConnections() return the same Connection
instance.
getConnection in interface ConnectionFactoryinfo - the connection parametersSQLExceptionpublic void closeConnections()
throws SQLException
CachingConnectionFactorycloseConnections in interface CachingConnectionFactorySQLExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.