Link to home
Start Free TrialLog in
Avatar of xz02
xz02

asked on

class not found in type declaration?

Hi,
 I am trying to use Orcle thin driver within JDK1.1.
The program is as simple as this:

import java.sql.*;
class JdbcApplication {
  public static void main (String args []) throws SQLException {
    // Load Oracle driver
    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
     
    // Connect to the local database
    Connection conn =
      DriverManager.getConnection ("jdbc:oracle:thin:@199.81.96.83:1521:mkprod",
                                   "forecast_dba", "forecast");

    // Query the employee names
    Statement stmt = conn.createStatement ();
    ResultSet rset = stmt.executeQuery ("select country from outlook");

      // Print the name out
    while (rset.next ())
      System.out.println (rset.getString (1));
  }
}

But the compiler keeps saying "class oracle.jdbc.driver.OracleDriver() not found in
type declaration". I have set the right classpath.
Please help.
ASKER CERTIFIED SOLUTION
Avatar of GregL
GregL

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial