当前位置: 技术问答>java相关
奇怪的问题?
来源: 互联网 发布时间:2015-07-21
本文导语: 我写了一个程序,要用到orcle的jdbc驱动, 我已经在classpath李设置了d:oracleora81jdbclibclasses12.zip 我运行用dos程序可以成功, 但我用jcreator它报 java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver at java.net.URLCla...
我写了一个程序,要用到orcle的jdbc驱动,
我已经在classpath李设置了d:oracleora81jdbclibclasses12.zip
我运行用dos程序可以成功,
但我用jcreator它报
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:130)
at testDB.main(testDB.java:12)
SQLException: No suitable driver
Press any key to continue...
没有匹配的驱动
我已经在classpath李设置了d:oracleora81jdbclibclasses12.zip
我运行用dos程序可以成功,
但我用jcreator它报
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:130)
at testDB.main(testDB.java:12)
SQLException: No suitable driver
Press any key to continue...
没有匹配的驱动
|
在jcreator的project/project settings/reqired libraries 下再这个包添加进来。应为jcreator自己给你管理classpath.
|
应该在jcreator中添加该包:
project->project settings-〉reqired libraries
project->project settings-〉reqired libraries