Link to home
Start Free TrialLog in
Avatar of sunshine737
sunshine737

asked on

setting path for oracle classes

im having my java and oracle installed in c:

java - C:\j2sdk1.4.2_03

oracle - C:\oracle\cli92\jdbc\doc\javadoc.zip

i want to set path to access the above zip classes from the java prg.

can somebody tell me how to do this

thanks
Avatar of zzynx
zzynx
Flag of Belgium image

Avatar of Giant2
Giant2

>C:\oracle\cli92\jdbc\doc\javadoc.zip
This seems a documentation file, not a jar one.
If you want to reach this zip file (maybe for accessing the information in it) you can instruct your program to see this directory (maybe the path).
I think you want oracle database driver to make a connection to oracle from java program.

For that you have to use C:\oracle\ora92\jdbc\lib\ojdbc14.jar

There are  2 ways to put into classpath.
1) you set into system properties by adding
 CLASSPATH=.;..;other_jar_files.jar;C:\oracle\ora92\jdbc\lib\ojdbc14.jar

2) when you start program pass into parameter
java -classpath C:\oracle\ora92\jdbc\lib\ojdbc14.jar MyJavaProgram

hope this helps, else mention more detail.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sunshine737

ASKER

thanks for the responses, actually when im running my prg its giving me an error called as
java.lang.NoClassDefFoundError: oracle/jdbc2/Clob

when i checked in the internet, the solution provided was that i shld open the oracle directory and in it the jdbc and in it i find many zip files and these i shld include them in the classpath

so i tried something like

SETPATH = %C:\j2sdk1.4.2_03\jre\lib\ext;C:\oracle\cli92\jdbc\lib%PATH%

but nothing is getting included when im checking out my classpaths through my ide

so basically i want my prg to access this lib folder in the oracle directory
>> SETPATH = %C:\j2sdk1.4.2_03\jre\lib\ext;C:\oracle\cli92\jdbc\lib%PATH%
You certainly mean
     SET PATH = C:\j2sdk1.4.2_03\jre\lib\ext;C:\oracle\cli92\jdbc\lib;%PATH%

>> but nothing is getting included when im checking out my classpaths through my ide
What ide do you use?
If it's netBeans you should mount all the jar's you need ( Right-click File Systems > Mount > Archive Files )


im using an ide called javabeginner
Don't know that one.
But often an IDE doesn't "follow" the usual path settings and uses its own way of setting the paths...
thanks i could solve it, i have just copied all the files to the ext folder and its working fine

thanks objects
no worries :)