Tomcat 5.5 Connection pool configuration, how to make engineering the default engineering _linux

Source: Internet
Author: User
Just add this to the
Copy Code code as follows:

<context docbase= "C:/Program files/apache Software Foundation/tomcat5.5/webapps/fengyue" "Path=" "0" Reloadable= "true" privileged= "true" >
<resource name= "aaa/oracleds" type= "Javax.sql.DataSource"
Password= "maxtie17061706"
Driverclassname= "Oracle.jdbc.driver.OracleDriver"
Maxidle= "2"
maxwait= "5000"
Username= "Maxtie"
Url= "Jdbc:oracle:thin:@192.168.0.13:1521:mmis"
Maxactive= "4"/>
</Context>


This is the default project plus connection pool configured, if you want to not as the default project, just change path on the AH

If you only match the default project:

Copy Code code as follows:

<context docbase= "C:/Program files/apache Software Foundation/tomcat5.5/webapps/fengyue" "Path=" "0" Reloadable= "true" privileged= "true" ></Context>


The key is this path.

Finally, the test code must be run in the Web project.

Copy Code code as follows:

InitialContext CTX = new InitialContext ();
DataSource ds = (DataSource) ctx.lookup ("Java:comp/env/aaa/oracleds");
conn = Ds.getconnection ();

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.