我的tomcat5.5.17 三个jar包已放入D:\AnZhuan\Tomcat 5.5\common\lib中
在D:\AnZhuan\Tomcat 5.5\conf下建了个bbs.xml 内容如下:
<Context path="/bbs" docBase="D:\AnZhuan\Tomcat 5.5\conf" debug="5" reloadable="true">
<Resource name="jdbc/TestDB" type="javax.sql.DataSource"
maxActive="10" maxIdle="3" maxWait="10000" username="sa" password="123" driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://localhost;DatabaseName=bbs"/>
</Context>
我的项目中的web.xml内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<description>SQL Test App</description>
<resource-ref>
<description>test</description>
<res-ref-name>jdbc/TestDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
现在报:org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
驱动我已装了,配了为什么还报这种错呢???
好心人救救我啊!
在D:\AnZhuan\Tomcat 5.5\conf下建了个bbs.xml 内容如下:
<Context path="/bbs" docBase="D:\AnZhuan\Tomcat 5.5\conf" debug="5" reloadable="true">
<Resource name="jdbc/TestDB" type="javax.sql.DataSource"
maxActive="10" maxIdle="3" maxWait="10000" username="sa" password="123" driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://localhost;DatabaseName=bbs"/>
</Context>
我的项目中的web.xml内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<description>SQL Test App</description>
<resource-ref>
<description>test</description>
<res-ref-name>jdbc/TestDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
现在报:org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
驱动我已装了,配了为什么还报这种错呢???
好心人救救我啊!
可是你的配置文件用的不是jdbc-odbc桥
用你的配置文件采用的url连接试试看