[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

how to change classpath settings

iam  writing   some jsp's, servlet's, javabeans
iam using NetBeansIDE3.6 ,  it is shipped with tomcat  5.1 server.  Till now,i've used
JDBC - ODBC Bridge Driver.  Now  i Want to use   OracleDriver.  i've copied the  corresponding classes111.jar  and classes12.jar  into   common folder of TOMCAT  installation directory.  But iam getting  ClassNotFoundException if i use The Statement
class.forName("oracle.jdbc.OracleDriver"); in  my jdbc program.

And also  i wanted use OracleResultSet,.  it is unable to compile my  java file.
And the NetBeansIDE is showing  Red mark as some mistake is there in this line

Please let me Know how to use OracleDriver and  Oracle API. How to Change the CLASSPATH settings to include Oracle jar files.

0
sdushyanth
Asked:
sdushyanth
  • 4
  • 4
  • 3
3 Solutions
 
TimYatesCommented:
you just need classes12.zip

copy it into the shared/lib directory
0
 
girionisCommented:
First of all make sure that the OracleDriver class is in the oracle.jdbc package. Second try moving the jar files into your /lib folder of your web app (should be in the /WEB-INF folder) and see if you still can't access the class.

To use the OracleResultSet make sure that the CLASSPATH is set correctly. TO do that you can try (assumign *nix)

javac -classpath $CLASSPATH:<path to OracleResutlSet> <your java class>.java
0
 
TimYatesCommented:
Errr...  in tomcat? ;-)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
girionisCommented:
What about Tomcat?
0
 
TimYatesCommented:
Sorry...ignore me...  I wasn't thinking :-(

/me runs off and hides...
0
 
girionisCommented:
:)
0
 
kupra1Commented:
you need to add not only the classes12.zip in the lib folder but also you have to set the path of the zip file in the lib folder like this:
../../lib/classes12.zip (make sure to add the zip filename in the path)
It will take care of your Oracle driver too.
Finally, you can use the Oracle Resultset by using the following command:

javac -classpath $CLASSPATHOracleResutlSetpath TestOracleResultSet.java
0
 
TimYatesCommented:
> you need to add not only the classes12.zip in the lib folder but also you have to set the path of the zip file in the lib folder like this:

?
0
 
kupra1Commented:
i meant if you want to add the classes12.zip in the folder, do something like this on the command prompt:

set classpath=%classpath%;C:/tomcat/webapps/mywebapp/WEB-INF/lib/classes12.zip;

and not only
set classpath=%classpath%;C:/tomcat/webapps/mywebapp/WEB-INF/lib.

0
 
girionisCommented:
I'd say split the points between all participants.
0
 
kupra1Commented:
i agree with girionis.:)
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now