tomcat5.0与tomcat5.5连接池数据源的配置区别
utl: http://guoruisheng-163-com.iteye.com/blog/1275150
问题:
当出现如下错误:
Cannot create JDBC driver of class '' for connect URL 'null'
应该考虑如下两种不同导致的错误。
1、 tomcat5.5的配置方式
<Context path="/ggsbase" debug="0" reloadable="true" crossContext="true">
<Resource name="jdbc/hiDataSource2" auth="Container" type="javax.sql.DataSource"
maxActive="10" maxIdle="5" maxWait="10000"
username="ggsbase" password="abc" driverClassName="com.oscar.Driver"
url="jdbc:oscar://172.24.186.17:2003/OSRDB"/>
<Resource name="jdbc/hiDataSource3" auth="Container" type="javax.sql.DataSource"
maxActive="10" maxIdle="5" maxWait="10000"
username="ggsbase" password="hgjhgj" driverClassName="com.oscar.Driver"
url="jdbc:oscar://172.24.186.17:2003/OSRDB"/>
</Context>
</Host>
参见:http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
2、tomcat5.0
<Context path="/ggsbase" debug="0" reloadable="true" crossContext="true">
<Resource name="jdbc/hiDataSource2" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/hiDataSource2">
<parameter>
<name>driverClassName</name>
<value>com.oscar.Driver</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>50</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>5</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<parameter>
<name>username</name>
<value>hgj</value>
</parameter>
<parameter>
<name>password</name>
<value>hgj</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oscar://172.24.186.17:2003/OSRDB</value>
</parameter>
</ResourceParams>
</Context>
</Host>