In Tomcat (rightly) the new jdbc-pool also has a statement cache. You can enable and configure it using the JDBC interceptor , which is set as a JDBC property during pool creation .
Please see the documentation for more information and configuration options.
This is mainly done as follows:
PoolProperties p = new PoolProperties(); p.setUrl("jdbc:your-jdbc-url"); p.setDriverClassName("your.jdbc.driver.class"); p.setUsername("user"); p.setPassword("password"); p.setJdbcInterceptors( "org.apache.tomcat.jdbc.pool.interceptor.StatementCache"); DataSource datasource = new DataSource(); datasource.setPoolProperties(p);
Mralwasser
source share