/** * Sets whether to use caching for {@link Statement} instances. * @param cache whether to cache {@code Statement} instances */ public void setCacheStatements(boolean cache) { // Release statements if required. if (cacheS && !cache) { try { flushSpareStatements(); } catch (SQLException sqlx) { log_warn(pool.getName() + ": " + sqlx.getMessage(), sqlx); } } this.cacheS = cache; }
/** * 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; }
/** * Sets whether to use caching for {@link CallableStatement} instances. * @param cache whether to cache {@code CallableStatement} instances */ public void setCacheCallableStatements(boolean cache) { // Release statements if required. if (cacheC && !cache) { try { flushSpareCallableStatements(); } catch (SQLException sqlx) { log_warn(pool.getName() + ": " + sqlx.getMessage(), sqlx); } } this.cacheC = cache; }
log_warn(pool.getName() + ": " + sqlx.getMessage(), sqlx);