jdbc connection using thin driver

血红的双手。 提交于 2019-12-24 06:35:49

问题


i am connecting oracle 10g xe with java but getting the exception java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

Even if i have included the classpath of driver i.e ojdbc14.jar
if i have set wrong classpath please tell me the correct way to set the classpath


回答1:


note that running a JAR (double-click ou "java -jar file.jar") does not use the CLASSPATH environment variable

How Classes are Found

In that case - running a JAR - you must set the Class-Path attribute in the manifest file

JAR File Specification




回答2:


I think you want to use oracle.jdbc.OracleDriver. I believe the oracle.jdbc.driver.OracleDriver was deprecated and removed between 9i and 10g.




回答3:


That depends on how you are running your application. Normally you can set the classpath via the env var CLASSPATH, or the command-line-switch -cp.

Please provide more details of your environment.




回答4:


If you are running your application as a Web Application in Tomcat, the ojdbc14.jar must be in, I believe, {tomcat_home}/server/lib. That or {tomcat_home}/common/lib... but I'm pretty sure it's server/lib.




回答5:


I found it in a jar file called classes12.jar in oracle app server 9.0.4.



来源:https://stackoverflow.com/questions/723223/jdbc-connection-using-thin-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!