The Artima Developer Community
Sponsored Link

Java Answers Forum
Oracle driver problem

6 replies on 1 page. Most recent reply: Apr 4, 2002 4:53 AM by abhijeet

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 6 replies on 1 page
Hendra

Posts: 2
Nickname: hendra
Registered: Apr, 2002

Oracle driver problem Posted: Apr 3, 2002 5:50 PM
Reply to this message Reply
Advertisement
I tried to access oracle database for java, but I got this error message: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

this is part of my code to connect to Oracle:

Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@machinename:port:SID","username" , "password");

Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * from TAB");

Anybody please help me.

thanks,
Hendra


Hendra

Posts: 2
Nickname: hendra
Registered: Apr, 2002

Re: Oracle driver problem Posted: Apr 3, 2002 6:09 PM
Reply to this message Reply
Addition, to make it clearer, I tried to print the stack trace.. and this is the result:

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at Test.main(Test.java:14)
Press any key to continue . . .

thx,
Hendra

Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Re: Oracle driver problem Posted: Apr 3, 2002 6:11 PM
Reply to this message Reply
the driver needs to be in the classpath.

Palani kumar

Posts: 7
Nickname: coolgossip
Registered: Mar, 2002

Re: Oracle driver problem Posted: Apr 3, 2002 10:38 PM
Reply to this message Reply
Hai
make sure that u have classes111.zip or classes12.zip is in your classpath ;

Palanikumar

abhijeet

Posts: 13
Nickname: aaraje
Registered: Mar, 2002

Re: Oracle driver problem Posted: Apr 4, 2002 1:22 AM
Reply to this message Reply
how to set classpath
if my classes111.zip is on c drive

Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Re: Oracle driver problem Posted: Apr 4, 2002 1:32 AM
Reply to this message Reply
set CLASSPATH=C:\classes.zip

abhijeet

Posts: 13
Nickname: aaraje
Registered: Mar, 2002

Re: Oracle driver problem Posted: Apr 4, 2002 4:53 AM
Reply to this message Reply
Thanks

Flat View: This topic has 6 replies on 1 page
Topic: load and image processing on multipage tiff image Previous Topic   Next Topic Topic: Programming a forum in Java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use