Cannot create JDBC driver of class '' for connect URL 'null' 错误
今天在使用润乾报表的时候,出现了一个错误:Cannot create JDBC driver of class '' for connect URL 'null'
当我们用Tomcat5.0.XX时,以Oracle为例,一般我们的配置如下,但直接移到5.5.XX时就会发生错误
<Resource name="jdbc/XXX" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/XXX">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>password</name>
<value>password</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc
racle:thin:@localhost:1521:SID</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>username</name>
<value>username</value>
</parameter>
</ResourceParams>
当要移植到Tomcat5.5.XX时,配置应当修改一下,如下所示:
<Resource
name="jdbc/XXX"
type="javax.sql.DataSource"
password="password"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="username"
url="jdbc
racle:thin:@localhost:1521:SID"
maxActive="4"/>
上面的错误消失以后,紧接着出现了:
Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'
修改方法如下:
1. 将servlet-api.jar和classes12.jar考到WEB-INF/lib目录下
2. 将servlet-api.jar和classes12.jar考到\Tomcat 5.0\common\lib下