public class PreparedStatementCache extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private LruMap<String,PooledPreparedStatement> |
cache |
private DailyQueryStatistics |
queryStatistics |
| 构造器和说明 |
|---|
PreparedStatementCache(int maxSize,
DailyQueryStatistics queryStatistics)
To create a PreparedStatementCache with a LruMap
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected PooledPreparedStatement |
createObject(String sql,
Connection connection,
Method method,
Object[] args)
Create a PooledPreparedStatement object
|
void |
destroy()
Destroy the cache
|
void |
giveback(String sql,
PooledPreparedStatement pps) |
int |
size() |
PooledPreparedStatement |
take(String sql,
Connection connection,
Method method,
Object[] args) |
private final LruMap<String,PooledPreparedStatement> cache
private final DailyQueryStatistics queryStatistics
public PreparedStatementCache(int maxSize,
DailyQueryStatistics queryStatistics)
maxSize - lruCache's sizepublic void destroy()
public int size()
public void giveback(String sql, PooledPreparedStatement pps) throws SQLException
SQLExceptionpublic PooledPreparedStatement take(String sql, Connection connection, Method method, Object[] args) throws SQLException
SQLExceptionprotected PooledPreparedStatement createObject(String sql, Connection connection, Method method, Object[] args) throws SQLException
sql - connection - method - args - SQLExceptionCopyright © 2021. All rights reserved.