Forum Stats

  • 3,784,163 Users
  • 2,254,899 Discussions


java - oracle -jdbc(driver problem)

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 ( ())
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(

at java.lang.ClassLoader.loadLibrary(

at java.lang.Runtime.loadLibrary0(

at java.lang.System.loadLibrary(

at oracle.jdbc.oci7.OCIDBAccess.logon(

at oracle.jdbc.driver.OracleConnection.<init>(

at oracle.jdbc.driver.OracleDriver.connect(

at java.sql.DriverManager.getConnection(

at java.sql.DriverManager.getConnection(

at Employee.main(, Compiled Code)

Exception in thread "main" Process Exit...


  • 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.