tomcat6连接人大金仓 报No suitable driver

今天配置tomcat6 连接kingbaseES7时,启动报:

1
java.sql.SQLException: No suitable driver

开始以为是jar包问题,换了几个kingbase,jar也没有用,
驱动jar的位置也都在war包,jre 下放过,都还是报这个错

后面发现在连接字符串有问题

1
2
3
4
5
6
<Resource name="jdbc/egrant_ruizw"
type="com.mchange.v2.c3p0.ComboPooledDataSource"
maxPoolSize="3" minPoolSize="1" acquireIncrement="1" maxIdleTime="120" checkoutTimeout="3000"
initialPoolSize="1" factory="org.apache.naming.factory.BeanFactory"
user="rui" password="ruifw" driverClass="com.kingbase.Driver"
jdbcUrl="jdbc:kingbase:@192.168.1.25:54321:SJkJH" /> #注意这行

要改为:

1
2
3
4
5
6
<Resource name="jdbc/egrant_ruizw"
type="com.mchange.v2.c3p0.ComboPooledDataSource"
maxPoolSize="3" minPoolSize="1" acquireIncrement="1" maxIdleTime="120" checkoutTimeout="3000"
initialPoolSize="1" factory="org.apache.naming.factory.BeanFactory"
user="rui" password="ruifw" driverClass="com.kingbase.Driver"
jdbcUrl="jdbc:kingbase://192.168.1.25:54321/SJkJH" />

这样就行了.

# linux
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×