views:

39

answers:

1

I wanto to run my JDBC-connection (either Oracle or MSSQL) through a proxy-server. Reason for this is to have additional controls of the traffic, especially for developing.

I know, I could specify the proxy, which runs on my machine, and the port in the connection-string. But the specified connection-settings are only taken as some kind of handshake to agree on which port the data is finally transferred. And this is defenitly not the port which I have under proxy-control.

So, does anybody have an idea, how to specify the port for the data-transfer? I would prefer if this could be done in the connection-string. The same issue applies for Oracle and MSSQL.

Thx

LeO

A: 

For Oracle:

jdbc:oracle:<drivertype>:<username/password>@<database>

The <drivertype> is one of

  • thin
  • oci
  • kprb

The <database> description somewhat depends on the driver type. If the driver type is kprb, then the <database> description is empty. If the driver type is oci and you wish to use a bequeath connection, then the <database> is empty. Otherwise (thin or oci driver and not bequeath) the database description is one of the following:

//<host>:<port>/<service>
<host>:<port>:<SID>
<TNSName>

Example:

jdbc:oracle:oci:@myhost:1521:inst1

See Oracle JDBC FAQ for more details.

Antonio
Fine, but I doubt, my question was understood properly. 1521 is the port over which the negotionation is done. But where and HOW to specify which port for the data-transfer is used?
LeO