Java – Tomcat JDBC connection resource not published
I have a project using Tomcat JDBC connection pool
According to JDK specification, connection The close () method should release the connected resources, such as statement and resultset
I know that when using a connection in the pool, the close () method will be overridden to release the connection back to the pool I want to know if this overridden method should properly close related resources
Tomcat JDBC connection pool does not release resources. I need to explicitly close all resources in the code
Is there any other pool that actually calls connection Close() to close all related resources correctly?
Solution
You can use the interceptor to configure Tomcat JDBC
http://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html#org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer