@Override public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { if (!open) throw new SQLException(MSG_CONNECTION_CLOSED); CachedPreparedStatement x = new CachedPreparedStatement(sql, con.prepareStatement(sql, columnNames)); x.setCacheable(false); x.setStatementListener(this); synchronized(nonCacheable) { nonCacheable.add(x); } return x; }
@Override public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { if (!open) throw new SQLException(MSG_CONNECTION_CLOSED); CachedPreparedStatement x = new CachedPreparedStatement(sql, con.prepareStatement(sql, columnIndexes)); x.setCacheable(false); x.setStatementListener(this); synchronized(nonCacheable) { nonCacheable.add(x); } return x; }
@Override public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { if (!open) throw new SQLException(MSG_CONNECTION_CLOSED); CachedPreparedStatement x = new CachedPreparedStatement(sql, con.prepareStatement(sql, autoGeneratedKeys)); x.setCacheable(false); x.setStatementListener(this); synchronized(nonCacheable) { nonCacheable.add(x); } return x; }
if (!cacheP) cps = new CachedPreparedStatement(sql, con.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability)); cps.setCacheable(false); cps.setStatementListener(this); cps = new CachedPreparedStatement(sql, con.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability)); cps.setCacheable(true); cps.setStatementListener(this);