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.