Solved

setting path for oracle classes

Posted on 2004-09-23
10
315 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

896 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

12 Experts available now in Live!

Get 1:1 Help Now