username="root"removeAbondoned="true"/> 其中XXX是你的项目路径 web.xml好像不用特别的配置吧。如果需要可以加入下面的 Mysql Datasource example jdbc/ifcp javax.sql.DataSource
求MySql利用Tomcat实现数据库连接池的数据源配置文件?
server.xml中的配置
<Context docBase="XXX" path="/XXX" reloadable="true" source="com.ibm.wtp.web.server:XXX">
<Resource auth="Container"
driverClassName="com.mysql.jdbc.Driver" maxActive="10"
maxIdle="10" maxWait="-1"
name="jdbc/ifcp" password="123"
type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/XXX?charactorEncoding=utf8"
username="root"
removeAbondoned="true"
/>
</Context>
其中XXX是你的项目路径
web.xml好像不用特别的配置吧。如果需要可以加入下面的
<resource-ref>
<description>Mysql Datasource example</description>
<res-ref-name>jdbc/ifcp</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope> Unshareable</res-sharing-scope>
</resource-ref>2009-05-18