Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: JDBC
Cindy,
Thanks. I looked at the document. I'm not sure whether I have the thin or the OCI driver. I ran the following sample program:
import oracle.jdbc.driver.*;
import java.sql.*;
public class JDBCTest {
public static void main(String[] argv) throws Exception, SQLException {
String dbURL = argv[0];
System.out.println( dbURL );
String username = "ucboulder";
String password = "ucboulder";
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
} catch (Exception e) {
e.printStackTrace();
throw new Exception("Cannot load Driver " +
"oracle.jdbc.driver.OracleDriver");
}
try {
Connection conn = DriverManager.getConnection(dbURL, username, password);
} catch (SQLException e) {
e.printStackTrace();
throw new SQLException(e.getMessage());
}
}
}
The results for both the thin and OCI drivers were:
at java.lang.ClassLoader.loadLibrary(ClassLoader.java, Compiled Code) at java.lang.Runtime.loadLibrary0(Runtime.java, Compiled Code) at java.lang.System.loadLibrary(System.java, Compiled Code)at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java, Compiled Code) at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java, Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code) at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code) at JDBCTest.main(JDBCTest.java, Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code) at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code) at JDBCTest.main(JDBCTest.java, Compiled Code)Exception in thread "main" java.sql.SQLException: The Network Adapter could not establish the connection
which makes me believe I'm not running a thin driver. But I've no idea what to make of:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
Any idea?
-Sam Received on Tue Jan 04 2000 - 17:12:37 CST