Topic: 关于数据库找不到驱动的问题

  Print this page

1.关于数据库找不到驱动的问题 Copy to clipboard
Posted by: lxi
Posted on: 2003-03-12 17:50

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

请教各位大虾,不知道为什么这条语句在一个程序中能用,在一个程序中老是说找不到这个驱动。小妹先在此谢过了。

2.Re:关于数据库找不到驱动的问题 [Re: lxi] Copy to clipboard
Posted by: dissip
Posted on: 2003-03-12 20:23

I think you should check wether the class is inclueded in the CLASSPATH

3.Re:关于数据库找不到驱动的问题 [Re: lxi] Copy to clipboard
Posted by: lxi
Posted on: 2003-03-13 10:59

我用的VisualAge for java 4.0
我用的驱动是 sun.jdbc.odbc.JdbcOdbcDriver
整个驱动的包的层次结构都包含了。不会是CLASSPATH的问题吧?

4.Re:关于数据库找不到驱动的问题 [Re: lxi] Copy to clipboard
Posted by: snowbug
Posted on: 2003-03-14 00:08

I believe that class in included in the rt.jar file. Don't know how you imported that package into VAJ. Anyway, before you run the app, do a "check classpath"->"compute now", and make sure the package is included. You might need to manually edit it.

Try to run the same class from the command line. If it works, then it is your VAJ setting problem.

5.Re:关于数据库找不到驱动的问题 [Re: lxi] Copy to clipboard
Posted by: yahoo163
Posted on: 2003-03-15 16:05

比较一下你两次的CODE还有他们的运行环境有什么不同,要不然不会有错的


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923