org.postgresql.core
Class CachedQuery

java.lang.Object
  extended by org.postgresql.core.CachedQuery
All Implemented Interfaces:
CanEstimateSize

public class CachedQuery
extends Object
implements CanEstimateSize

Stores information on the parsed JDBC query. It is used to cut parsing overhead when executing the same query through Connection.prepareStatement(String).


Field Summary
 boolean isFunction
           
 Object key
          Cache key.
 boolean outParmBeforeFunc
           
 Query query
           
 
Constructor Summary
CachedQuery(Object key, Query query, boolean isFunction, boolean outParmBeforeFunc)
           
 
Method Summary
 int getExecuteCount()
          Number of times this statement has been used
 long getSize()
           
 void increaseExecuteCount()
           
 void increaseExecuteCount(int inc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

public final Object key
Cache key. String or org.postgresql.jdbc.CallableQueryKey. It is assumed that String.valueOf(key)*2 would give reasonable estimate of the number of retained bytes by given key (see getSize()).


query

public final Query query

isFunction

public final boolean isFunction

outParmBeforeFunc

public final boolean outParmBeforeFunc
Constructor Detail

CachedQuery

public CachedQuery(Object key,
                   Query query,
                   boolean isFunction,
                   boolean outParmBeforeFunc)
Method Detail

increaseExecuteCount

public void increaseExecuteCount()

increaseExecuteCount

public void increaseExecuteCount(int inc)

getExecuteCount

public int getExecuteCount()
Number of times this statement has been used

Returns:
number of times this statement has been used

getSize

public long getSize()
Specified by:
getSize in interface CanEstimateSize


Copyright © 2016 PostgreSQL Global Development Group. All rights reserved.