日期:2014-05-16  浏览次数:20448 次

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver解决方法!
点击右边红色标题查看本文完整版:java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver解决方法!

运行时出现错误信息如下:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at DbAccess.main(DbAccess.java:9)

Exception in thread "main " java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@192.168.11.12:1521:test
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at DbAccess.main(DbAccess.java:20)


说明:
 1,环境变量都已经配置,包括classes12.jar
 2,java -version信息如下:
   java version "1.6.0_02 "
   Java(TM) SE Runtime Environment (build 1.6.0_02-b06)
   Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode, sharing)
 3,安装的oracle即时客户端版本为10.2.0.3

忘各位大侠帮忙!

------解决方法--------------------
换一个驱动吧
ojdbc14.jar
------解决方法--------------------
我也碰到过你这样的情况
把classes12.jar放到 磁盘目录 \j2sdk\jre\lib\ext 里就可以了

------解决方法--------------------
你用oracle\ora92\jdbc\lib\目录下的jar试试
------解决方法--------------------
跟web服务器的规范有问题 个人认为