com.espertech.esper.epl.db
Class ConnectionCacheImpl

java.lang.Object
  extended by com.espertech.esper.epl.db.ConnectionCache
      extended by com.espertech.esper.epl.db.ConnectionCacheImpl

public class ConnectionCacheImpl
extends ConnectionCache

Caches the Connection and PreparedStatement instance for reuse.


Constructor Summary
ConnectionCacheImpl(DatabaseConnectionFactory databaseConnectionFactory, java.lang.String sql)
          Ctor.
 
Method Summary
 void destroy()
          Destroys cache closing all resources cached, if any.
 void doneWith(Pair<java.sql.Connection,java.sql.PreparedStatement> pair)
          Indicate to return the connection and statement pair after use.
 Pair<java.sql.Connection,java.sql.PreparedStatement> getConnection()
          Returns a cached or new connection and statement pair.
 
Methods inherited from class com.espertech.esper.epl.db.ConnectionCache
close, makeNew
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionCacheImpl

public ConnectionCacheImpl(DatabaseConnectionFactory databaseConnectionFactory,
                           java.lang.String sql)
Ctor.

Parameters:
databaseConnectionFactory - - connection factory
sql - - statement sql
Method Detail

getConnection

public Pair<java.sql.Connection,java.sql.PreparedStatement> getConnection()
Description copied from class: ConnectionCache
Returns a cached or new connection and statement pair.

Specified by:
getConnection in class ConnectionCache
Returns:
connection and statement pair

doneWith

public void doneWith(Pair<java.sql.Connection,java.sql.PreparedStatement> pair)
Description copied from class: ConnectionCache
Indicate to return the connection and statement pair after use.

Specified by:
doneWith in class ConnectionCache
Parameters:
pair - is the resources to return

destroy

public void destroy()
Description copied from class: ConnectionCache
Destroys cache closing all resources cached, if any.

Specified by:
destroy in class ConnectionCache

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com