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 ConnectionFactory
info
- the connection parametersSQLException
public void closeConnections() throws SQLException
CachingConnectionFactory
closeConnections
in interface CachingConnectionFactory
SQLException
Copyright © 2021 The Apache Software Foundation. All rights reserved.