public interface StatementCache
There are two types of attributes that the cache is concerned with:
String
generated from the SQL query for which the
prepared statement was created, the database name and the parameter
types; this key uniquely identifies a server-side preparation of the
statement and is used to retrieve the handle of the statement when it
needs to be executedsp_prepare
or
sp_cursorprepare
handle on the serverPreparedStatement
can map to multiple handles, depending on
the types of the parameters it is called with (hence the need to be able
to map both keys and SQL strings to handles)The caching types provided by jTDS should be:
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(java.lang.String key)
Returns a statement handle associated with the specified key or
null if the key specified does not have an associated
statement handle. |
java.util.Collection |
getObsoleteHandles(java.util.Collection handles)
Returns a
Collection of obsolete statement handles that may
be released, or null if no statement handles are obsolete. |
void |
put(java.lang.String key,
java.lang.Object handle)
Places the specified statement handle in the cache for the given key.
|
void |
remove(java.lang.String key)
Removes a statement key and handle from the cache for the specified key.
|
java.lang.Object get(java.lang.String key)
null
if the key specified does not have an associated
statement handle.key
- the statement key whose associated handle is to be returnedvoid put(java.lang.String key, java.lang.Object handle)
key
- the statement key to associated with the handlehandle
- the statement handlevoid remove(java.lang.String key)
key
- the statement key whose associated handle is to be removed
from the cachejava.util.Collection getObsoleteHandles(java.util.Collection handles)
Collection
of obsolete statement handles that may
be released, or null
if no statement handles are obsolete.handles
- the statement handles that are no longer being usedCollection
of obsolete statement handles to be
removedGenerated on June 8 2013