Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JDBC and the fly likes class not found exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "class not found exception " Watch "class not found exception " New topic

class not found exception

jawwad ahmed
Ranch Hand

Joined: Dec 01, 2001
Posts: 179
Hi all;
Well i am getting exception when loading driver.
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
The program is
import java.sql.*;
import oracle.jdbc.driver.OracleDriver;
public class A
public static void main(String args[]){
Connection con=null;
Statement stmt=null;
//con=DriverManager.getConnection("jdbc racle:thin:@JAWWAD:1521 EMREP","scott","tiger");
}catch(ClassNotFoundException e){
//catch(SQLException e){
//System.out.println("The Sql En caught is");
I have putten the class12.jar in g:\jdk1.3\jre\lib\ext\classes12.jar
Also have putten the oracle.jdbc.driver.OracleDriver in the path but no way found.
Can any body tell where i am wong please.
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
When using the "jre/lib/ext" method you need to be careful that you are putting your jars in the right place. On Windows systems, for example, there is often another "JRE" in Program Files, which may be used in preference to the one where you have put your jar file.
If you are running on a Windows system, please do a "find" on all your local disks to see if you have more than one such dirtectory. Of you have, try placing your Oracle jar in there as well.
Also, your "import" statement for the Oracle driver is not necessary, and may actually be wrong. When you create a class from it's name, you should not "import" it.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
It is sorta covered in the JavaRanch Style Guide.
subject: class not found exception
Similar Threads
How to configure oracle xe thin driver in xp
JDBC Error
Problem with conn to oracle
Network adapter couldn't establish connection with the database