Rakesh API

org.rakeshv.dbutils
Class StatementCache<S extends PreparedStatementDecorator>

java.lang.Object
  extended by org.rakeshv.dbutils.StatementCache<S>

public class StatementCache<S extends PreparedStatementDecorator>
extends java.lang.Object

A cache for storing PreparedStatement or CallableStatement objects. Some JDBC drivers and database servers handle this automatically. This class presents a means for doing the same for databases or drivers that do not support that feature.

Copyright 2005 Rakesh Vidyadharan

Version:
$Id: ConnectionFactory.java,v 1.2 2005/10/29 22:27:38 rakesh Exp $
Author:
Rakesh Vidyadharan 2005-11-21

Field Summary
private  ObjectCache<java.lang.String,S> cache
          The map used to cache the prepared statements.
 
Constructor Summary
StatementCache()
          Default constructor.
StatementCache(int cacheSize)
          Create a new instance which will hold at most the number of statements specified.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

private ObjectCache<java.lang.String,S extends PreparedStatementDecorator> cache
The map used to cache the prepared statements.

Constructor Detail

StatementCache

public StatementCache()
Default constructor. Initialises cache. No upper limit is placed on the statement cache size.


StatementCache

public StatementCache(int cacheSize)
Create a new instance which will hold at most the number of statements specified.


Rakesh API

Copyright © 2002-2005 - Rakesh Vidyadharan