TOMCAT 数据源配置的问题

meran meran 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我是按如下配置的


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


<Resource name="jdbc/sqlconnpool"

auth="Container"

type="javax.sql.DataSource"

driverClassName="com.mysql.jdbc.Driver"

url="jdbc:mysql://localhost:3306/store"

username="root"

password="root"

maxActive="100"

maxIdle="30"

maxWait="10000" />


</Context>




上面是tomcat 下面的 context

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>ServletTest</display-name>


<resource-ref>

<description>DB Connection</description>

<res-ref-name>jdbc/sqlconnpool</res-ref-name>

<res-type>javax.sql.DataSource</res-type>

<res-auth>Container</res-auth>

</resource-ref>

</web-app>

报错是[code=Java]
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'



感觉是读不到参数啊。。。求拯救


[/code]
...全文
评论 18
收藏 已收藏
分享
返回顶部
meran
Java EE 67,535 成员 225,843 内容