开发者

Connect oracle 11g database using java 1.7

开发者 https://www.devze.com 2023-03-30 01:16 出处:网络
Please help me.I have installed Oracle 11g on Windows 7 (32 bit) and i\'m trying to connect database with jdk 1.7

Please help me.I have installed Oracle 11g on Windows 7 (32 bit) and i'm trying to connect database with jdk 1.7

but i get an error saying

package or开发者_运维百科acle.jdbc.driver does not exist

Oracle 11g is installed in E: Drive.

I have pointed my Path and CLASSPATH as following

CLASSPATH

C:\Program Files\Java\jdk1.7.0

E:\app\malisa\product\11.2.0\dbhome_1\jdbc\lib

The following jar files are in the location E:\app\malisa\product\11.2.0\dbhome_1\jdbc\lib

ojdbc5

ojdbc5_g

ojdbc5dms

ojdbc5dms_g

ojdbc6

ojdbc6_g

ojdbc6dms

ojdbc6dms_g

simplefan

Thanks in advance

Malisa


Specifying just a directory does not add the jar files in that directory to the classpath. You must add the jar file explicitly to your classpath like so --

E:\app\malisa\product\11.2.0\dbhome_1\jdbc\lib\ojdbc.jar

Or if you want to add multiple jar files, then you could use wildcards like this

E:\app\malisa\product\11.2.0\dbhome_1\jdbc\lib\*

Take a look at how to set classpath in Java 7.


You could put the JAR file in the JRE/lib/ext directory. That means it will be on the classpath of every Java application. This is a little heavy handed though.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号