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 driver - Class oracle.jdbc.driver.OracleDriver not found.

229899Mar 4 2002
Greetings:

When I tried to compile an test script (as attached below) to test the driver, I always ended up with the following error message:

....java:17: Class oracle.jdbc.driver.OracleDriver not found.
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

Could somebody shine some light on it? I would very much appreciate it.


By the way, I have an Oracle DBMS (8.1.7) with jre1.1.7. My Java is jdk1.2 and the driver is ocijdbc8.dll

Wil

*************** The test script *************
import java.sql.*;

class Users
{
public static void main (String args [])
throws SQLException, ClassNotFoundException
{
// Load the Oracle JDBC driver
Class.forName ("oracle.jdbc.driver.OracleDriver");

// Connect to the database
// You can put a database name after the @ sign in the connection URL.
Connection conn =
DriverManager.getConnection ("jdbc:oracle:oci8:@US10", "QM24202E", "QM24202E");

// Create a Statement
Statement stmt = conn.createStatement ();

// Select ... table
ResultSet rset = stmt.executeQuery ("select USERID from USERS");

// Iterate through the result and print the ... names
while (rset.next ())
System.out.println (rset.getString (1));
}
}

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2002
Added on Mar 4 2002
7 comments
5,860 views