如何在Java,MySQL和Tomcat 6中使用连接池 [英] How to use connection pool with java,MySQL and Tomcat 6
问题描述
如何在Java + MySQL + Tomcat 6中使用连接池?
How can I use Connection pool in Java+MySQL+Tomcat 6?
我已阅读本文 http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html ,但对我来说仍然不太清楚。
I've read this article http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html but it is still not quite clear for me.
我在哪里使用连接器/ J?是否将其放在静态变量中?我是否使用SessionListener?是否需要任何配置?
Where do I use the Connector/J? Do I put it in a static variable? Do I use a SessionListener? Does it need any configuration?
谢谢!
推荐答案
您应该阅读 Tomcat 6 JNDI文档。查找 JDBC数据源部分,它将告诉您所有有关与Tomcat池化连接所需的知识。
You should read the Tomcat 6 JNDI document. Look for the "JDBC Data Sources" section and it will tell you everything you need to know about pooling connections with Tomcat.
这篇关于如何在Java,MySQL和Tomcat 6中使用连接池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!