|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for a statement cache. Abstraction of the caching mechanism by use of this interface will allow developers to create custom caching schemes that are optimal for their specific applications. Any synchronization required by an implementation should utilize the implementing object for the lock.
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:
Method Summary | |
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. |
Method Detail |
public 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 returned
public void put(java.lang.String key, java.lang.Object handle)
key
- the statement key to associated with the handlehandle
- the statement handlepublic void remove(java.lang.String key)
key
- the statement key whose associated handle is to be removed
from the cachepublic java.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 used
Collection
of obsolete statement handles to be
removed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |