com.espertech.esper.epl.db
Class ConnectionNoCacheImpl

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

public class ConnectionNoCacheImpl
extends ConnectionCache

Implementation of a connection cache that simply doesn't cache but gets a new connection and statement every request, and closes these every time a client indicates done.


Constructor Summary
ConnectionNoCacheImpl(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

ConnectionNoCacheImpl

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

Parameters:
databaseConnectionFactory - is the connection factory
sql - is the 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