这里是tomcat conf context配置
<Resource name="jdbc/DBPoo"
auth="Container"
type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/tarena"
username="cai"
password="chiaicai123"
maxActive="20"
maxIdle="10"
maxWait="10000"/>
这里是web.xml配置
<?xml version="1.0" encoding="UTF-8"?>
<xml-body>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<resource-ref>
<res-ref-name> jdbc/DBPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</xml-body>
我的南方