Solved

setting path for oracle classes

Posted on 2004-09-23
10
324 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Where to store the queries for modification of table 4 64
servlet requestdispatcher include and forward differences 1 32
servlet example 11 40
runtime exception 2 30
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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 will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to implement Singleton Design Pattern in Java.

832 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