Solved

setting path for oracle classes

Posted on 2004-09-23
10
301 Views
Last Modified: 2006-11-17
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
0
Comment
Question by:vihar123
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 37

Expert Comment

by:zzynx
ID: 12134268
0
 
LVL 12

Expert Comment

by:Giant2
ID: 12135301
>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).
0
 

Expert Comment

by:vorapranav
ID: 12135571
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.
0
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 12138680
Copy the driver jar to your jre(s) 'ext' directory and it will automatically get included in your classpath
0
 

Author Comment

by:vihar123
ID: 12140779
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
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 37

Expert Comment

by:zzynx
ID: 12140816
>> 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 )


0
 

Author Comment

by:vihar123
ID: 12140832
im using an ide called javabeginner
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12140840
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...
0
 

Author Comment

by:vihar123
ID: 12140882
thanks i could solve it, i have just copied all the files to the ext folder and its working fine

thanks objects
0
 
LVL 92

Expert Comment

by:objects
ID: 12140921
no worries :)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now