|
||||||||||
| 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 | |
|---|---|
String |
calculateCacheKey(String sql,
int autoGeneratedKeys)
Alternate version of autoGeneratedKeys. |
String |
calculateCacheKey(String sql,
int[] columnIndexes)
Calculate a cache key. |
String |
calculateCacheKey(String sql,
int resultSetType,
int resultSetConcurrency)
Cache key calculation. |
String |
calculateCacheKey(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Simply appends the given parameters and returns it to obtain a cache key |
String |
calculateCacheKey(String sql,
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(String key)
Retrieves the cached statement identified by the given key |
StatementHandle |
get(String sql,
int autoGeneratedKeys)
Retrieves the cached statement identified by the given key |
StatementHandle |
get(String sql,
int[] columnIndexes)
Retrieves the cached statement identified by the given key |
StatementHandle |
get(String sql,
int resultSetType,
int resultSetConcurrency)
Retrieves the cached statement identified by the given key |
StatementHandle |
get(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Retrieves the cached statement identified by the given key |
StatementHandle |
get(String sql,
String[] columnNames)
Retrieves the cached statement identified by the given key |
void |
putIfAbsent(String key,
StatementHandle handle)
Wrapper for map putIfAbsent. |
int |
size()
Returns size of the cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, 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 String calculateCacheKey(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
calculateCacheKey in interface IStatementCachesql - resultSetConcurrency - resultSetHoldability - resultSetType -
public String calculateCacheKey(String sql,
int resultSetType,
int resultSetConcurrency)
calculateCacheKey in interface IStatementCachesql - stringresultSetType - resultSetConcurrency -
public String calculateCacheKey(String sql,
int autoGeneratedKeys)
calculateCacheKey in interface IStatementCachesql - autoGeneratedKeys -
public String calculateCacheKey(String sql,
int[] columnIndexes)
calculateCacheKey in interface IStatementCachesql - to usecolumnIndexes - to use
public String calculateCacheKey(String sql,
String[] columnNames)
calculateCacheKey in interface IStatementCachesql - to usecolumnNames - to use
public StatementHandle get(String key)
get in interface IStatementCachekey - SQL statement
IStatementCache.get(java.lang.String)
public StatementHandle get(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(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(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(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(String sql,
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 int size()
size in interface IStatementCacheIStatementCache.size()public void clear()
clear in interface IStatementCacheIStatementCache.clear()public void checkForProperClosure()
IStatementCache
checkForProperClosure in interface IStatementCache
public void putIfAbsent(String key,
StatementHandle handle)
IStatementCache
putIfAbsent in interface IStatementCache
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||