Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-02-2007, 06:57 PM
Member
 
Join Date: Aug 2007
Posts: 4
ljustiniano is on a distinguished road
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
Hi everybody

I'm new in java Platform and i have problems trying to load a JDBC driver using Class.forname, but JVM can not find it. I configured classpath enviroment path pointig to libraries

OS: Windows XP
Java Version 1.6
IDE Eclipse 3.2.2

classpath = .;C:\Program Files\Altova\xmlspy\XMLSpyInterface.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;D:\oracle\ora92\jdbc\lib\ classes12.zip


java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at bpos.Db.Conectar(Db.java:20)
at bpos.Process.main(Process.java:19)


Can anybody help me about this? It will appreciate.

Leo
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-03-2007, 06:04 PM
Member
 
Join Date: Aug 2007
Posts: 2
netrista is on a distinguished road
Hello Leo,

Try putting the full path to the Oracle classes12.zip file at the front of the CLASSPATH. Also remove the extra space between the \ and classes12.zip.

Before you test with an app, ensure the driver returns version information by running this command on the command line:

java oracle.jdbc.driver.OracleDriver

If that command does not work, you still have environment problems and need to revisit before you test with the app.

Best regards,
Netrista Khatam
Technical Services Manager
OpenLink Product Support
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-03-2007, 06:33 PM
Member
 
Join Date: Aug 2007
Posts: 4
ljustiniano is on a distinguished road
it doesn't work yet...
Hi Netrista.. thank you for your help.. I checked my enviroment variables and i didn't find problems. I think that was copy paste mistake. I put first the oracle driver library reference into the classpath enviroment variable

C:\>echo %classpath%
.;D:\oracle\ora92\jdbc\lib\classes12.zip;C:\Progra m Files\Altova\xmlspy\XMLSpyInterface.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar

I performed your suggested command and i couldn't get the version of each class i'm trying to use

C:\>java oracle.jdbc.driver.OracleDriver
Exception in thread "main" java.lang.NoSuchMethodError: main

C:\>java com.microsoft.jdbc.sqlserver.SQLServerDriver
null

any other thing that it could be used? thanks!

Leo
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 08-03-2007, 07:10 PM
Member
 
Join Date: Aug 2007
Posts: 2
netrista is on a distinguished road
Hello Leo,

This is what I would recommend:

1. Verify that the following path is correct:

D:\oracle\ora92\jdbc\lib\classes12.zip

2. Insure no permissions issues exist on that file or directory structure, which is unlikely since it is Windows.

3. Run this command to get your java version:

java -version

4. Insure that the java version of the JVM/JDK that you have installed on Windows is compatible with the requirements of the driver.

Can you state whether or not you can use the other JDBC drivers to get a connection using the application, even though they error on the commandline with DOS. I've seen that before, so it's important to ascertain whether the app connectivity issue is specific to Oracle or generalized to all JDBC connections.


Best regards,
Netrista Khatam
Technical Services Manager
OpenLink Product Support
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 08-06-2007, 06:30 PM
Member
 
Join Date: Aug 2007
Posts: 4
ljustiniano is on a distinguished road
Fixed!
Thank you very much.

The classpath was correct. I proved on command line and it worked correctly. So i have to change my approach looking for into my IDE project definition parameters. I' m using Eclipse and i found that i have to define a classpath for the project.

Ups! I'm new in Eclipse too.. and i forgot mention it. Your description of the solution helped me to find the final solution. Thank you!

Leo
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver haneeshrawther Advanced Java 0 03-21-2008 02:13 PM
failure at Class.forName("oracle.jdbc.driver.OracleDriver"); RonNYC Eclipse 1 03-14-2008 03:51 PM
Jdbc Driver For Oracle Swamipsn New To Java 0 08-14-2007 05:31 AM
ClassNotFoundException com.mysql.jdbc.Driver Heather Database 2 06-30-2007 03:42 PM
java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver Marcus Database 1 06-27-2007 06:57 PM


All times are GMT +3. The time now is 09:02 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org