Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
池的哪些设置jdbc可以帮助我杀死运行超过 1 秒的 sql 查询?
jdbc
当我说tomcat jdbc pool我的意思是目录中的资源context.xml时/tomcat/conf/。
tomcat jdbc pool
context.xml
/tomcat/conf/
看起来 tomcat 池提供了一个开箱即用的拦截器来为您执行此操作。看...
https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html#org.apache.tomcat.jdbc.pool.interceptor.QueryTimeoutInterceptor
您应该能够将这些拦截器之一添加到您的配置中
(注意:该文档说仍然由 JDBC 驱动程序来强制执行查询超时。)