Re: Defining local IP address when opening connections to database - Mailing list pgsql-jdbc

From Scott Harrington
Subject Re: Defining local IP address when opening connections to database
Date
Msg-id alpine.WNT.2.00.1203071356590.6596@turks
Whole thread Raw
In response to Defining local IP address when opening connections to database  (Michael Bauland <Michael.Bauland@knipp.de>)
List pgsql-jdbc
On Wed, 7 Mar 2012, Michael Bauland wrote:

> I've got a problem when using the PostgreSQL JDBC driver to open a
> connection to a database (not using SSL). The server on which I'm using
> the driver has several IPs configured, but I would like to use a certain
> IP (since only for that IP the firewalls have been set-up to allow the
> connection to the database). Looking at the documentation I couldn't
> find a way to define this local IP.
> Have I missed something? If not, would it be possible to add this
> feature of defining the local IP when setting up a connection?

You haven't missed anything. I had the same requirement a while ago and
needed to patch (see attached) my local build to bind to a localAddress
specified in the JDBC properties.

I find it useful to bind to a particular local address not only for
routing but also simply to improve the connection logs.

Hope this helps.

Attachment

pgsql-jdbc by date:

Previous
From: Michael Bauland
Date:
Subject: Re: Defining local IP address when opening connections to database
Next
From: John R Pierce
Date:
Subject: Re: Defining local IP address when opening connections to database