2

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 oracle.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

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.