|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jolbox.bonecp.StatementCache
public class StatementCache
JDBC statement cache.
| Constructor Summary | |
|---|---|
StatementCache(int size,
boolean maintainStats,
Statistics statistics)
Creates a statement cache of given size. |
|
| Method Summary | |
|---|---|
java.lang.String |
calculateCacheKey(java.lang.String sql,
int autoGeneratedKeys)
Alternate version of autoGeneratedKeys. |
java.lang.String |
calculateCacheKey(java.lang.String sql,
int[] columnIndexes)
Calculate a cache key. |
java.lang.String |
calculateCacheKey(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Cache key calculation. |
java.lang.String |
calculateCacheKey(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Simply appends the given parameters and returns it to obtain a cache key |
java.lang.String |
calculateCacheKey(java.lang.String sql,
java.lang.String[] columnNames)
Calculate a cache key. |
void |
checkForProperClosure()
Checks that the entries in the cache have been properly closed when the connection dies down. |
void |
clear()
Clears the cache |
StatementHandle |
get(java.lang.String key)
Retrieves the cached statement identified by the given key |
StatementHandle |
get(java.lang.String sql,
int autoGeneratedKeys)
Retrieves the cached statement identified by the given key |
StatementHandle |
get(java.lang.String sql,
int[] columnIndexes)
Retrieves the cached statement identified by the given key |
StatementHandle |
get(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Retrieves the cached statement identified by the given key |
StatementHandle |
get(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Retrieves the cached statement identified by the given key |
StatementHandle |
get(java.lang.String sql,
java.lang.String[] columnNames)
Retrieves the cached statement identified by the given key |
void |
put(java.lang.String key,
StatementHandle handle)
Stores the given Statement in a cache. |
int |
size()
Returns size of the cache. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StatementCache(int size,
boolean maintainStats,
Statistics statistics)
size - of cache.maintainStats - if true, keep track of statistics.statistics - statistics handle.| Method Detail |
|---|
public java.lang.String calculateCacheKey(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
calculateCacheKey in interface IStatementCachesql - resultSetConcurrency - resultSetHoldability - resultSetType -
public java.lang.String calculateCacheKey(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
calculateCacheKey in interface IStatementCachesql - stringresultSetType - resultSetConcurrency -
public java.lang.String calculateCacheKey(java.lang.String sql,
int autoGeneratedKeys)
calculateCacheKey in interface IStatementCachesql - autoGeneratedKeys -
public java.lang.String calculateCacheKey(java.lang.String sql,
int[] columnIndexes)
calculateCacheKey in interface IStatementCachesql - to usecolumnIndexes - to use
public java.lang.String calculateCacheKey(java.lang.String sql,
java.lang.String[] columnNames)
calculateCacheKey in interface IStatementCachesql - to usecolumnNames - to use
public StatementHandle get(java.lang.String key)
get in interface IStatementCachekey - SQL statement
IStatementCache.get(java.lang.String)
public StatementHandle get(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
IStatementCache
get in interface IStatementCachesql - SQL StatementresultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLEresultSetHoldability - a ResultSet holdability constant; one of ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
public StatementHandle get(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
IStatementCache
get in interface IStatementCachesql - SQL StatementresultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
public StatementHandle get(java.lang.String sql,
int autoGeneratedKeys)
IStatementCache
get in interface IStatementCachesql - SQL StatementautoGeneratedKeys - a flag indicating whether auto-generated keys should be returned; one of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS
public StatementHandle get(java.lang.String sql,
int[] columnIndexes)
IStatementCache
get in interface IStatementCachesql - SQL StatementcolumnIndexes - an array of column indexes indicating the columns that should be returned from the inserted row or rows
public StatementHandle get(java.lang.String sql,
java.lang.String[] columnNames)
IStatementCache
get in interface IStatementCachesql - SQL StatementcolumnNames - an array of column names indicating the columns that should be returned from the inserted row or rows
public void put(java.lang.String key,
StatementHandle handle)
put in interface IStatementCachekey - SQL statementhandle - JDBC StatementIStatementCache.put(java.lang.String, com.jolbox.bonecp.StatementHandle)public int size()
size in interface IStatementCacheIStatementCache.size()public void clear()
clear in interface IStatementCacheIStatementCache.clear()public void checkForProperClosure()
IStatementCache
checkForProperClosure in interface IStatementCache
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||