第40行替換為:
pstmt = ((OracleConnection)conn).getStatementWithKey ("cache_test1");
if (pstmt==null)
第46行替換為:
((OraclePreparedStatement)pstmt).closeWithKey ("cache_test1");
這樣通過手工編碼的方式控制哪些語句需要緩存,哪些不需要。
關于語句緩存(Statement Caching)可以參考Oracle在線文檔:Statement and Result Set Caching
原文轉自:http://blogread.cn/it/article/6685