|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.orindasoft.pub.StatementParameters2
com.orindasoft.pub.DmlStatement
com.orindasoft.pub.QueryStatement
public class QueryStatement
A SELECT statement with caching.
This class implements a parameterized SQL statement with query result caching that continues to exist even if the connection it uses is withdrawn. It extends DMLStatement
(c) Copyright 2003 - 2012 Orinda Software Ltd
| Field Summary | |
|---|---|
static int |
CACHE_FOREVER
Constant for caching data for the life of the class. |
static int |
CACHE_NEVER
Constant for not caching data. |
static int |
DEFAULT_QUERIES_CACHED
Default value for how many different queries we can cache... |
static int |
DEFAULT_QUERY_ROWS
Default value for how many rows returned by a query we actually use... |
| Constructor Summary | |
|---|---|
QueryStatement(java.lang.String statementSqlText,
LogInterface theLog)
Create a DML Statement object. |
|
QueryStatement(java.lang.String statementSqlText,
LogInterface theLog,
java.sql.Connection theConnection)
Create a DML Statement object and give it a connection |
|
| Method Summary | |
|---|---|
void |
clearCache()
Clear the cache. |
ReadOnlyRowSet |
execute()
Execute the statement and return a ReadOnlyRowSet If caching is in use the cache will be checked and a cached copy returned if possible. |
int |
getBufferSize()
Get current file io buffer size |
int |
getCacheSize()
Return the number of queries currently in the cache. |
long |
getErrors()
Return counter containing number of errors. |
long |
getExecutions()
Return counter containing number of executions. |
long |
getExecutionTime()
Return counter containing time spent executing statement in milliseconds. |
boolean |
getKeepFiles()
Get keepFiles flag |
boolean |
getKeepLobs()
Get keepLobs |
java.lang.String |
getLatestQuerySignature()
Return an up to date signature of the query parameters. |
long |
getParses()
Return counter containing number of parses. |
long |
getParseTime()
Return counter containing time spent parsing in milliseconds. |
long |
getReleases()
Return counter containing number of releases. |
long |
getRetrievalTime()
Return counter containing time spent retrieving data in milliseconds. |
java.io.File |
getTempDir()
Get temporary directory |
java.lang.String |
getTempFilePrefix()
Get the prefix used for generating temporary files |
java.lang.String |
getTempFileSuffix()
Get the suffix used for generating temporary files |
boolean |
getUseByteArraysForLongsAndLOBS()
Get keepLobs |
int |
purgeExpiredCacheEntries(int howManyMilliseconds)
Remove entries that are too old from the cache |
int |
purgeUnderusedCacheEntries(int minAcceptableReuses,
int howManyMilliseconds)
Remove entries that have not been reused from the cache |
void |
resetStatsCounters()
Reset all stats counters to 0. |
void |
setBufferSize(int bufferSize)
Set new file io buffer size |
void |
setCacheRows(int newCacheRows)
Specify how many results will be cached. |
void |
setCacheSeconds(int newCacheSeconds)
Specify how long results will be cached. |
void |
setKeepFiles(boolean keepFiles)
Set keepFiles |
void |
setKeepLobs(boolean keepLobs)
Set keepLobs |
void |
setQueryRows(int newQueryRows)
Specify how many rows can be brought back |
void |
setTempDir(java.io.File tempFileDir)
Set temporary directory |
void |
setTempFilePrefix(java.lang.String tempFilePrefix)
Set the prefix used for generating temporary files |
void |
setTempFileSuffix(java.lang.String tempFileSuffix)
Set the suffix used for generating temporary files |
void |
setUseByteArraysForLongsAndLOBS(boolean useByteArraysForLongsAndLOBS)
SetUseByteArraysForLongsAndLOBS |
| Methods inherited from class com.orindasoft.pub.DmlStatement |
|---|
connectionIsUsable, freeConnection, getUnderlyingStatement, hasResources, releaseResources, setConnection |
| Methods inherited from class com.orindasoft.pub.StatementParameters2 |
|---|
bindParameters, checkBuild, checkSet, clearParameters, getParam, getParamCount, getParameters, getSignature, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setPlSqlTableArrayParam |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.orindasoft.pub.OracleResourceUser |
|---|
hasResources, releaseResources |
| Field Detail |
|---|
public static final int DEFAULT_QUERY_ROWS
public static final int DEFAULT_QUERIES_CACHED
public static final int CACHE_FOREVER
public static final int CACHE_NEVER
| Constructor Detail |
|---|
public QueryStatement(java.lang.String statementSqlText,
LogInterface theLog,
java.sql.Connection theConnection)
public QueryStatement(java.lang.String statementSqlText,
LogInterface theLog)
| Method Detail |
|---|
public void setCacheSeconds(int newCacheSeconds)
int - newCacheSecondspublic void setCacheRows(int newCacheRows)
int - newCacheSecondspublic int getCacheSize()
public void clearCache()
public void setQueryRows(int newQueryRows)
int - newQueryRows
public ReadOnlyRowSet execute()
throws CSException
CSExceptionpublic int purgeExpiredCacheEntries(int howManyMilliseconds)
int - howManyMilliseconds The maximum amount of time to be spent removing entries.
public int purgeUnderusedCacheEntries(int minAcceptableReuses,
int howManyMilliseconds)
int - minAcceptableReuses How many times an entry must have been used to avoid
deletion.int - howManyMilliseconds The maximum amount of time to be spent removing entries.
public java.lang.String getLatestQuerySignature()
public int getBufferSize()
public boolean getKeepFiles()
true if temporary files are kept after the JVM exits.public java.io.File getTempDir()
public java.lang.String getTempFilePrefix()
public java.lang.String getTempFileSuffix()
public void setBufferSize(int bufferSize)
int - bufferSize A new Buffersize in bytes.public void setKeepFiles(boolean keepFiles)
boolean - keepFiles Keep generated files after JVM exitspublic void setKeepLobs(boolean keepLobs)
boolean - keepLobs Keep LOB objects such as CLOB, BLOB and BFILE as LOBS instead of turning them into files on retrieval.public void setUseByteArraysForLongsAndLOBS(boolean useByteArraysForLongsAndLOBS)
boolean - useByteArraysForLongsAndLOBS flag that specifies whether lobs such as CLOBS, BLOBS and BFILES
and LONG columns will be kept as byte arrayspublic boolean getKeepLobs()
public boolean getUseByteArraysForLongsAndLOBS()
public void setTempDir(java.io.File tempFileDir)
throws CSException
java.io.File - tempFileDir a new Temporary Directory
CSException - if the directory is not viablepublic void setTempFilePrefix(java.lang.String tempFilePrefix)
public void setTempFileSuffix(java.lang.String tempFileSuffix)
public void resetStatsCounters()
resetStatsCounters in interface StatsInterfaceSee StatsInterface - a generic set of performance measuring methodspublic long getParses()
getParses in interface StatsInterfaceSee StatsInterface - a generic set of performance measuring methodspublic long getParseTime()
getParseTime in interface StatsInterfaceSee StatsInterface - a generic set of performance measuring methodspublic long getExecutions()
getExecutions in interface StatsInterfaceSee StatsInterface - a generic set of performance measuring methodspublic long getExecutionTime()
getExecutionTime in interface StatsInterfaceSee StatsInterface - a generic set of performance measuring methodspublic long getRetrievalTime()
getRetrievalTime in interface StatsInterfaceSee StatsInterface - a generic set of performance measuring methodspublic long getReleases()
getReleases in interface StatsInterfaceSee StatsInterface - a generic set of performance measuring methodspublic long getErrors()
getErrors in interface StatsInterfaceSee StatsInterface - a generic set of performance measuring methods
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||