Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> JDBC or TCP/IP problem with Oracle

JDBC or TCP/IP problem with Oracle

From: Carol King <csk_at_enterprise.net>
Date: Wed, 22 Sep 1999 06:15:18 +0100
Message-ID: <37E865E5.F4BC8147@enterprise.net>

I am trying to connect to Personal Oracle 8 on a Windows 95 system using the JDBC drivers. Even though I use "localhost" or "127.0.0.1" as the host address, it appears that my machine is trying to go out on to the network!

I am using the sample Employee.java file which came in the downloaded demo file from Oracle. I used JDK1.2.2 to compile and started the database. Here are the results using the following compilation commands:

javac -classpath .;H:\orawin95\jdbc\lib\816classes12.zip Employee.java java -cp .;H:\orawin95\jdbc\lib\816classes12.zip Employee



  // Connect to the database
    // You can put a database name after the @ sign in the connection URL.
    Connection conn =
      DriverManager.getConnection
("jdbc:oracle:thin:@localhost:1521:ORCL", "scott", "tiger");

cd h:/orawin95/jdbc/demo/samples/oci8/basic-samples/ java -cp .;H:\orawin95\jdbc\lib\816classes12.zip Employee java.sql.SQLException: The Network Adapter could not establish the connection
 at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:406)  at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:169)  at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:231)

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

 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"
Compilation exited abnormally with code 1 at Fri Sep 17 14:49:40

// Connect to the database

    // You can put a database name after the @ sign in the connection URL.
    Connection conn =
      DriverManager.getConnection
("jdbc:oracle:oci8:@localhost:1521:ORCL", "scott", "tiger");

cd h:/orawin95/jdbc/demo/samples/oci8/basic-samples/ java -cp .;H:\orawin95\jdbc\lib\816classes12.zip Employee java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path

 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1249)
 at java.lang.Runtime.loadLibrary0(Runtime.java:470)
 at java.lang.System.loadLibrary(System.java:768)
 at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:202)  at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:156)  at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:231)

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

 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"
Compilation exited abnormally with code 1 at Fri Sep 17 14:42:36

I could not get the bequeth protocol (beq-local.world) to work either as it appears that the JDBC connect command needs a TCP/IP address.

Can anyone help?

Cheers,
Carol Received on Wed Sep 22 1999 - 00:15:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US