JSP,tomcat配置mysql数据库连接出错

1. 配置tomcat下的conf下的context.xml文件

1 <Resource name="jdbc/tmstest" auth="Container"
2 type="javax.sql.DataSource"
3 driverClassName="com.mysql.jdbc.Driver"
4 url="jdbc:mysql://localhost:3306/tmstest"
5 username="root" password=""
6 maxActive="200" maxIdle="30"
7 maxWait="-1"/>

2. 配置web.xml,在<web-app></web-app>之间加入

<resource-ref>
<description>JDBC Connection</description>
<res-ref-name>jdbc/tmstest</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>



 



posted on 2011-12-19 19:14  clara_babybear  阅读(247)  评论(0编辑  收藏  举报