Re: Connecting to oracle (via JDBC) from unix through a firewall

From: Laurenz Albe <>
Date: 25 Jun 2008 08:15:15 GMT
Message-ID: <>

Juha Laiho <> wrote:
>>I am trying to access my employer's Oracle server through a Java
>>application (using JDBC thin). "I originally tried ssh -L
>>1521:$serverIP$:1521 user@$employerShellServer$" but I quickly
>>discovered that Oracle tries to make a second connection back to the
>>client via a random port. I've looked at previous threads on this
>>newsgroup on how to fix this problem but many of them refer to Oracle
>>Metalink (which I don't have an account for) or specify adding
>>registry keys (which won't work in linux/OS X).
>>I've also tried changing my JDBC url to specify SERVER=DEDICATED
>>(example below) but I only get the same error (IO Exception: The
>>Network Adapter could not establish the connection).

> That should work (or in other words, that works for me). Looks
> like you also forgot your example from the message, so I can't
> check whether the problem would be caused by errors in the URL.

It should *not* work, as far as I know.

The original post is mistaken; it is not the server that makes a connection back to the client, but the client that opens a "second" connection.

In short, the procedure is as follows:

  1. Client connects to the listener, usually on port 1521.
  2. Listener spawns a new server process which is listening on a random port.
  3. Listener sends client a "resend" packet that informs the client where it should connect.
  4. Client (or listener, I don't know) drops the connection.
  5. Client connects to the dedicated server process on the new port.

Laurenz Albe Received on Wed Jun 25 2008 - 03:15:15 CDT

Original text of this message