Alex: Oracle JDBC Treiber

Beitrag lesen

Hallo,

ich verwende Oracle 9i als Datenbank und möchte via JDBC auf die Datenbank zugreifen. Bei der folgenden Java-Applikation erscheint jedoch immer die Fehlermeldung:

"Exception in thread "main" java.lang.NoClassDefFoundError: Employee"

Ich nehme mal an, das Programm findet den Treiber nicht!?
Hängt das mit der Umgebungsvariable ORACLE_HOME und dem CLASSPATH zusammen????
Wenn ja, wie müssen die gesetzt werden????

Danke

Alex

------------------------------------------------------------
import java.sql.*;

class Employee
{
  public static void main (String args [])
       throws SQLException
  {
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new 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:@alex-0560nntbn1:1521:oracle", "scott", "tiger");

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

// Select the ENAME column from the EMP table
    ResultSet rset = stmt.executeQuery ("select ENAME from EMP");

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

// Close the RseultSet
    rset.close();

// Close the Statement
    stmt.close();

// Close the connection
    conn.close();
  }
}
-------------------------------------------------