I tried to use Oracle's JDBC/OCI driver to contact Oracle
database. My computer environment as following:
Window NT 4.O1 Oracle 7.3.4 Java JDK 1.2.2 Oracle8i 8.1.6.0.1 JDBC-OCI/WIN NT driver for JDK1.2 I can compile the following codes:
<CODE>
import java.net.URL;
import java.sql.*;
public class jdbc3{
public static void main(
String args[]) {
String url = "jdbc
racle
ci8:@ORCL";
Connection con;
String createString;
createString = "insert into SUP(SUP_ID,SUP_NAME,STREET,
CITY,STATE,ZIP)"+"VALUES(102,'Tofu,Inc.','99 Passaic
Street','Passaic','NJ','07009');";
Statement stmt;
try {
DriverManager.registerDriver (new oracle.jdbc.driver.
OracleDriver());
con = DriverManager.getConnection(url, "xxx",
"xxxxxx");
stmt = con.createStatement();
stmt.executeUpdate(createString);
stmt.close();
con.close();
}
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
}
}
</CODE>
However, I failed to run the above code in Java. I always got
the same wrong message as following:
Exception in the thread"main" java.lang.NoClassDefFoundError:
oracle/jdbc/driver/oracleDriver This thing drove me crazy. I checked all the oracle documents
about JDBC/OCI driver.It seems that the envrionment setting is
fine, the code is fine and it can compile. But it just does not
work.
Thanks for all possible helps for this problem.
Wai