|
SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.solarmetric.rd.jdbc.PreparedStatementCache
Implements a cache mapping a SQL string, PreparedStatementCache.CacheAwareConnection pair to
a PreparedStatement containing the same SQL using the same
connection. Use the newCacheAwareConnection(java.sql.Connection) to create a
connection wrapper that will automatically use this cache.
The cache uses a LRU algorithm to kick out old prepared statements when the given max size is exceeded.
| Nested Class Summary | |
class |
PreparedStatementCache.CacheAwareConnection
Connection wrapper class that uses the cache to prepare statements when possible. |
| Constructor Summary | |
PreparedStatementCache()
Default constructor. |
|
PreparedStatementCache(int maxSize)
Constructor. |
|
| Method Summary | |
int |
getMaxSize()
Return the maximum size of the cache. |
PreparedStatementCache.CacheAwareConnection |
newCacheAwareConnection(java.sql.Connection conn)
Return a PreparedStatementCache.CacheAwareConnection wrapper that is aware of this cache
and will use it when possible. |
void |
setMaxSize(int maxSize)
Set the maximum size of the cache. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public PreparedStatementCache()
public PreparedStatementCache(int maxSize)
maxSize - the size of the prepared statement cache| Method Detail |
public int getMaxSize()
public void setMaxSize(int maxSize)
public PreparedStatementCache.CacheAwareConnection newCacheAwareConnection(java.sql.Connection conn)
PreparedStatementCache.CacheAwareConnection wrapper that is aware of this cache
and will use it when possible.
public java.lang.String toString()
toString in class java.lang.Object
|
SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||