Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / January 2006

Tip: Looking for answers? Try searching our database.

JDBC access with Oracle

Thread view: 
TAO WU - 30 Jan 2006 04:57 GMT
Hello,

I got "java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver"
when trying to load Oracle driver using "Class.forName
("oracle.jdbc.driver.OracleDriver");"
I'm using Windows XP with Oracle 10g client installed, and I've checked
class12.jar and OJDBC14.jar exist under C:\Oracle_Install_Dir_Path\jdbc\lib

The test code looks like:

import java.sql.*;

public class Essential_JDBC {
public static void main (String[] args)
{
 try {

  //Load Oracle driver
  Class.forName ("oracle.jdbc.driver.OracleDriver");

 }
 catch (ClassNotFoundException cnfe){
  System.err.println(cnfe);
 }
 catch (SQLException sqle)
 {
  System.err.println(sqle);
 }
}

}
Roedy Green - 30 Jan 2006 06:28 GMT
>ClassNotFoundException

see http://mindprod.com/jgloss/caq.html

It simply can't find the JDBC driver.

check your oracle docs to make sure you have the driver's name right
and the Oracle JDBC driver jar is on your classpath or in the ext
directory, or whatever the install says you have to do to get it
visible.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Roedy Green - 30 Jan 2006 06:46 GMT
>I got "java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver"
>when trying to load Oracle driver using "Class.forName
>("oracle.jdbc.driver.OracleDriver");"

See wassup to dump the classpath you are actually using at that point
in your code.  System.getProperty ("java.library.path"):

Recall that a jar being in a directory where the directory is on the
classpath is not sufficient.

Then use jarlook to see if that driver is in the jar you think it is.

See http://mindprod.com/applets/wassup.html
http://mindprod.com/products1.html#JARLOOK
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.