Cannot create JDBC driver of class '' for connect URL 'null'

在尝试建立JDBC连接时遇到错误'Cannot create JDBC driver of class '' for connect URL 'null''。解决方法包括:1.正确配置Apache Tomcat的context.xml数据源;2.在WEB-INF/web.xml中设置资源引用;3.编写测试代码验证数据库连接池的配置是否成功。
摘要由CSDN通过智能技术生成

1.将C:\Program Files\apache-tomcat-7.0.29\conf下的context.xml文件配置为如下形式的数据源:


 

<?xml version='1.0' encoding='utf-8'?>

<Context>



    <!-- maxActive: Maximum number of database connections in pool. Make sure you

         configure your mysqld max_connections large enough to handle

         all of your db connections. Set to -1 for no limit.

         -->



    <!-- maxIdle: Maximum number of idle database connections to retain in pool.

         Set to -1 for no limit.  See also the DBCP documentation on this

         and the minEvictableIdleTimeMillis configuration parameter.

         -->



    <!-- maxWait: Maximum time to wait for a database connection to become available

         in ms, in this example 10 seconds. An Exception is thrown if

         this timeout is exceeded.  Set to -1 to wait indefinite
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值