About Tomcat configuration of multiple connection pooling issues

Source: Internet
Author: User
Tags auth connection pooling

About Tomcat configuring multiple connection pools
If it's TOMCAT5.
Meta-inf under the Context.xml
Make a change to this paragraph
<resource
Name= "Jdbc/aa"
Type= "Javax.sql.DataSource"
Driverclassname= "Com.microsoft.jdbc.sqlserver.SQLServerDriver"
Password= "123456"
Maxidle= "10"
maxwait= "-1"
Username= "123"
Url= "Jdbc:microsoft:sqlserver://127.0.0.1:1433;databasename=aa"
Maxactive= "/>"
Add to the back of the original, you need to make appropriate changes to the parameters

If it's TOMCAT4.
Change conf under Server.xml

<context path= "/gdmail" reloadable= "false" docbase= "Gdmail" >
<!--This is the first connection pool-->
<resource name= "Jdbc/dsmail" auth= "Container" type= "Javax.sql.DataSource"/>
<resourceparams name= "Jdbc/dsmail" >
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!--DBCP database connection Settings-->
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=GB2312</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>username</name>
<value>root</value>
</parameter>
<parameter>
<name>password</name>
<value>123456</value>
</parameter>
<!--DBCP connection pooling Options-->
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>36</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>36</value>
</parameter>
</ResourceParams>

<!--This is the second connection pool-->
<resource name= "Jdbc/oracledb" auth= "Container" type= "Javax.sql.DataSource"/>
<resourceparams name= "Jdbc/oracledb" >
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@192.168.0.10:1521:ering</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>username</name>
<value>admin</value>
</parameter>
<parameter>
<name>password</name>
<value>123456</value>
</parameter>

<parameter>
<name>maxWait</name>
<value>1000</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
</ResourceParams>
<!--second connection pool end-->
</Context>

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.