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 -> Re: JDBC or TCP/IP problem with Oracle

Re: JDBC or TCP/IP problem with Oracle

From: C. Ferguson <c_ferguson_at_rationalconcepts.com>
Date: Thu, 23 Sep 1999 07:26:02 GMT
Message-ID: <37E9D69C.EA2989DD@rationalconcepts.com>


Hi Carol,

   did you try putting the name of db machine in place of localhost?

Cindy

Carol King wrote:

> 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 Thu Sep 23 1999 - 02:26:02 CDT

Original text of this message

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