I am looking for a way to achieve PreparedStatement caching, so as to save recreating the PreparedStatement objects for queries that were already executed in the past.
Is there some built in way to achieve this using Tomcat? Or must I program this cache myself?
I believe tomcat uses commons-dbcp and commons-dbcp supports prepared statement pooling.
check it out here.
poolPreparedStatements false Enable prepared statement pooling for this pool.
Prepared statement caching is done by either your JDBC connection pool or your JDBC driver, not by Tomcat.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With