tomcat server.xml文件 Host节点中添加设置连接池和ROOT BASE工程.
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="D:\work\tomcatv6\webapps\MYPROJECTNAME" debug="0" reloadable="true" crossContext="true" privileged="true">
<Resource name="jdbc/***"
auth="Container"
type="javax.sql.DataSource"
url="jdbc:mysql://*****:3306/***?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull"
initialSize="2"
maxActive="20"
maxIdle="20"
minIdle="2"
maxWait="100"
removeAbandoned="true"
username="root"
password=""
poolPreparedStatements="true"
defaultAutoCommit="false"
driverClassName="com.mysql.jdbc.Driver"
/>
<Resource name="jdbc/omaha"
auth="Container"
type="javax.sql.DataSource"
url="jdbc:jtds:sqlserver://*****:1433/*****"
initialSize="1"
maxActive="1"
maxIdle="20"
minIdle="2"
maxWait="100"
removeAbandoned="true"
username="******"
password="******"
poolPreparedStatements="true"
defaultAutoCommit="false"
driverClassName="net.sourceforge.jtds.jdbc.Driver"
/>
</Context>
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
-->
</Host>