Forum Stats

  • 3,784,163 Users
  • 2,254,899 Discussions
  • 7,880,717 Comments

Discussions

java - oracle -jdbc(driver problem)

3004
3004 Member Posts: 204,171
The follwing is my source code. When I execute this code, I get error. Please help me.

import java.sql.*;

class Employee
{
public static void main (String args [])
throws SQLException, ClassNotFoundException
{
// Load the Oracle JDBC driver
//Class.forName ("oracle.jdbc.driver.OracleDriver");
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:@, 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));
}
}

____________________________________________

The following is error message:

java.lang.UnsatisfiedLinkError: C:\ORANT\BIN\OCI803JDBC.DLL: Can't find dependent libraries

at java.lang.ClassLoader$NativeLibrary.load(Native Method)

at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1319)

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1243)

at java.lang.Runtime.loadLibrary0(Runtime.java:470)

at java.lang.System.loadLibrary(System.java:768)

at oracle.jdbc.oci7.OCIDBAccess.logon(OCIDBAccess.java:138)

at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:93)

at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:146)

at java.sql.DriverManager.getConnection(DriverManager.java:457)

at java.sql.DriverManager.getConnection(DriverManager.java:137)

at Employee.main(Employee.java, Compiled Code)

Exception in thread "main" Process Exit...
__________________________________________

Comments

  • 3004
    3004 Member Posts: 204,171
    There's a JDBC group that's probably going to be better able to answer this question. ODBC is a different protocol (though some JDBC drivers do use existing ODBC drivers).

    Justin Cave
    Oracle ODBC Development
This discussion has been closed.