Tomcat6 MySQL JDBC connection pool Configuration

Source: Internet
Author: User

After one night, I checked n more articles, tried n more complex methods, and finally found a super simple method in an article, it's really just a waste of shoes! You do not need to follow the management method, as long as you follow the methods below, you can successfully configure the Tomcat connection pool.

 

Set the tomcat/CONF/context. xml file to the following content.

 

<Context reloadable = "true">
<Watchedresource> WEB-INF/Web. xml </watchedresource>
<Resource Name = "JDBC/MySQL" auth = "Container" type = "javax. SQL. datasource"
Maxactive = "100" maxidle = "30" maxwait = "10000" username = "root" Password = "root" driverclassname = "com. MySQL. JDBC. Driver"
Url = "JDBC: mysql: // localhost: 3306/databasename"/>
</Context>
Or put it under the META-INF of your project. The myslq table and the database driver must be properly placed and connected!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.