Data source configuration for tomcat5.0 under Eclipse

Source: Internet
Author: User
Tags db2

The settings for Tomcat in my eclipse:

Preference->tomcat->context Declaration mode->context Files

For example, when applied to Datacheck, the datacheck.xml is stored in the directory:

<tomcat Instaoll Home>/conf/catalina/localhost/datacheck.xml

Modify the Datacheck.xml and add the data source description. As shown below:

<context path= "/datacheck" reloadable= "true" docbase= D:/studio/workspace/datacheck "workdir=" D:/studio/ Workspace/datacheck/work "> <resource name=" Jdbc/datacheck auth= "Container" type= "Javax.sql.DataSource"/>
<resourceparams name= "Jdbc/datacheck" >
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>COM.ibm.db2.jdbc.app.DB2Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:db2:toolsctr</value>
</parameter>
<parameter>
<name>username</name>
<value>db2admin</value>
</parameter>
<parameter>
<name>password</name>
<value>db2icss</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>10</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>300</value>
</parameter>
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>30000</value>
</parameter>
</ResourceParams>
</Context>

Note: The library file for the database JDBC driver will be added to the <tomcat instaoll home>/common/lib.

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.