/** * Sets whether to use caching for {@link PreparedStatement} instances. * @param cache whether to cache {@code PreparedStatement} instances */ public void setCachePreparedStatements(boolean cache) { // Release statements if required. if (cacheP && !cache) { try { flushSparePreparedStatements(); } catch (SQLException sqlx) { log_warn(pool.getName() + ": " + sqlx.getMessage(), sqlx); } } this.cacheP = cache; }
flushSparePreparedStatements(); flushOpenPreparedStatements();