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