|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.solarmetric.datasource.PreparedStatementCache
Implements a cache mapping a SQL string, Connection 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. Only statements prepared using the default result set type and concurrency are cached.
| Constructor Summary | |
|---|---|
PreparedStatementCache(DataSourceImpl ds)
Default constructor. |
|
PreparedStatementCache(DataSourceImpl ds,
int maxSize)
Constructor. |
|
| Method Summary | |
|---|---|
int |
getMaxSize()
Return the maximum size of the cache. |
Connection |
newCacheAwareConnection(Connection conn)
Return a Connection wrapper that is aware of this cache
and will use it when possible. |
void |
setMaxSize(int maxSize)
Set the maximum size of the cache. |
String |
toString()
|
StringBuffer |
toString(StringBuffer buffer)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public PreparedStatementCache(DataSourceImpl ds)
public PreparedStatementCache(DataSourceImpl ds,
int maxSize)
maxSize - the size of the prepared statement cache| Method Detail |
public String toString()
toString in class Objectpublic StringBuffer toString(StringBuffer buffer)
public int getMaxSize()
public void setMaxSize(int maxSize)
public Connection newCacheAwareConnection(Connection conn)
Connection wrapper that is aware of this cache
and will use it when possible.
|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||