Configuring connection pooling in Tomcat

Source: Internet
Author: User

Configure the project path under Tomcat's Conf/catalina/localhost directory, and tomcat boot will load the project directly according to the configuration.
Although the configuration is a word, but often forget, write down today.
If your project is famous for: Mypro, then your file is named: Mypro.xml.
A word in the file: <context docbase= "D:\Workspaces\mypro\WebRoot" path= "/mypro" reloadable= "true"/>
Docbase is the project path, and path is the project name.

D:\Program Files\apachetomcat\tomcat 6.0\conf\catalina\localhost\mypro.xml

<?xml version= "1.0" encoding= "UTF-8"? ><context docbase= "D:\Program files\apachetomcat\tomcat 6.0\webapps\ Mypro "path="/mypro "reloadable=" true "><resource name=" Jdbc/mypro "auth=" Container "type=" Javax.sql.DataSource "maxactive=" "maxidle=" "maxwait=" "username=" "root" password= "root" driverclassname= " Com.mysql.jdbc.Driver "url=" Jdbc:mysql://localhost:3306/mypro?useunicode=true "/></context>

In the project's Web. XML configuration:

<resource-ref>  <description>mysql database connection pool </description>  <res-ref-name>jdbc/mypro </res-ref-name>  <res-type>javax.sql.DataSource</res-type>  <res-auth>container </res-auth></resource-ref>

  

  

Configuring connection pooling in Tomcat

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.