tomcat6.0+mysql5.0.7配置数据库连接池问题?在线等

来源:百度知道 编辑:UC知道 时间:2024/06/06 23:44:35
tomcat6.0+mysql5.0.7
我按照书上的做法,在我建的工程book里面web-inf下建了一个context.xml文件,如下是代码:
<Context>
<Resource name ="jdbc/boorg.apache.tomcat.dbcp.dbcp.SQLNestedException:Cannot create JDBC driver of class '' for connect URL 'null'"
auth="Container"
type="javax.sql.DataSource"
password= "null"
driverClassName="com.mysql.jdbc.Driver"
maxIdle="2"
maxWait="5000"
username="root"
url="jdbc:mysql://localhost:3306/mldn?autoReconnect=true"
maxActive="4"/>
<WatchedResource>Web-INF/web.xml</WatchedResource>
</Context>
在工程web-inf下也加入了如下代码:
<resource-ref>
<description>Datasource</description>
<res-ref-name>jdbc/book</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Containe

建议你还是在专业论坛提问,百度毕竟只是业余的,这么专业的问题我工作后没碰早忘了

我想请问下,你前面配了那么多,你在程序里面用到了吗?怎么还是用Class.forName来加载驱动?我怎么晕呼呼的.

我记得context.xml不是在web-inf目录下,而是在META-INF目录下。试试看。

conn = DriverManager.getConnection(DBURL,DBUSER,DBPASSWORD) ;

这句错了!

自己看帮助!