Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JDBC,Oracle - java.lang.ClassNotFoundException: oracle.jdbc.driver.Oracle

843854May 30 2002 — edited Jun 6 2002
I am using JBuilder5 which comes with jdk1.3. I have installed oracle 8.1.7 Enterprise version.
I am using Win NT 4.0.
I have set the PATH variable as E:\oracle\ora81\lib; and
CLASSPATH as : E:\oracle\ora81\jdbc\lib\classes12.zip;E:\oracle\ora81\jdbc\lib\nls_charset12.zip;
My JDBC code is

package sample2;
import java.sql.*;

public class Two {
Connection con;
Statement st;

public Two() {
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:oci8:@First","scott","tiger");
st = con.createStatement();
ResultSet rs = st.executeQuery("Select * from Book");
while(rs.next())
{
System.out.print(rs.getInt("ID")+"\t");
System.out.print(rs.getString("title")+"\t");
System.out.print(rs.getString("author")+"\t");
System.out.print(rs.getString("subject")+"\t");
System.out.println(rs.getInt("copies")+"\t");
}
st.close();
con.close();
}
catch(Exception ex)
{
System.out.println("Exception : " + ex.toString());
}
}
public static void main(String[] args) {
Two two1 = new Two();
}
}

I am getting this exception:
Exception : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

I can understand that the classpath for the driver is the problem here. I tried addding classes111.zip and nls_charset11.zip also in the class path. Even then I get the same exception.
Can anybody help me fix this problem?

Thanks in advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 4 2002
Added on May 30 2002
11 comments
230 views