1 22 package org.enhydra.jdbc.standard; 23 24 import org.enhydra.jdbc.util.LRUCache; 25 26 import java.sql.PreparedStatement ; 27 import java.sql.SQLException ; 28 29 33 public class PreparedStatementCache extends LRUCache { 34 35 38 public PreparedStatementCache(int maxSize) { 39 super(maxSize); 40 } 41 42 45 protected void cleanupObject(Object obj) { 46 if (obj != null) { 47 log.debug( 48 "PreparedStatementCache:cleanupObject class='" 49 + obj.getClass() 50 + "'"); 51 log.debug( 52 "PreparedStatementCache:cleanupObject close a PreparedStatement o=" 53 + "'" 54 + obj.toString() 55 + "'"); 56 } 57 try { 58 ((PreparedStatement ) obj).close(); 59 } catch (SQLException e) { 61 log.error( 62 "PreparedStatementCache:cleanupObject problem to close" 63 + "a PreparedStatement: " 64 + e); 65 } 66 } 67 68 } 69 | Popular Tags |