Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id F0A5719DE835 for ; Wed, 7 Mar 2012 12:50:12 -0400 (AST) Received: from smtp104.prem.mail.sp1.yahoo.com ([98.136.44.59]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1S5K3x-0002Xm-7i for pgsql-jdbc@postgresql.org; Wed, 07 Mar 2012 16:50:11 +0000 Received: (qmail 44421 invoked from network); 7 Mar 2012 16:49:51 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:Thread-Index:Content-Language; b=Y9qG8ddBVi7gmWvkOPzCjSazRadinFczdeFtQG0NH1WCLK9fKWQYSjcEpXHrZp1qJRThmDschYf/l/gFliDxM++jV3kdoTKefQlISYsyXCcFMn813Mi+vyACuDptxKZqk+YBX0mDesOkhGDvOw06N5uGIANONajwZO2WQObdduE= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1331138991; bh=wyerJK4kM10mli/Y8OR1r4kDg0tbCzs+poMoLFV3Z4U=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:Thread-Index:Content-Language; b=V8ZZ5sD+xLsXW0faUHjHF5C6RZCyoNBdp92btt9H4uU4mjiP9oMBLbtdVv/PX83ZabNGtZu36RVppIBzXTO8Ac6CejajsNFzVnral7by1UMvHl/BDS+hEWNYVWFTi6ISUPgEO4u0kS4OItz4a1BJK1f1d1ydgAZoGxOOjP5ASyk= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Wv1fdfMVM1kAJykf_t_Cw3D_A_H_tE0cdU37qEH6Ab1.WzY HFXysXK.yAtWX0m7MiIq9uIXF5xjSpSHzF8P3B7tbkPIOpjnDM4CEouv3AmL NKQHJ8D1QgpxXnOT7Wyf1CeCWYC_NjT6PL1U0z6w4wRLRV8USBREPF83M02F DjlaT_eY0Rny4_tK9C2JOPDIkxmkrncDZw8tM47kwnq0oGiPunkI4IAIZ5x8 uqyRwueFHU8nb_UJSR4uuxL0N3pEJQBKTw4TSqcV.0OOuMGt6R8j0NxVcOCb ZvFajplAlHnHP5ZPCDjia6JN1cL3p_AFeEl91Fqf3lF4C4LxbfRyd2FkTFKK M93GTyp4yeaFBIeqJCc9SFGPQDKZ00srkWcOvy0XnhO_jeisUgtKvOtI0aJd WMvUMTqHIvbx2WVPpF9b5 X-Yahoo-SMTP: mpGJl6eswBD2IBufoVEg0Pa8gg-- Received: from WolfDog (polobo@24.93.23.188 with login) by smtp104.prem.mail.sp1.yahoo.com with SMTP; 07 Mar 2012 08:49:50 -0800 PST From: "David Johnston" To: "'Michael Bauland'" , References: <4F578AB8.2050002@knipp.de> In-Reply-To: <4F578AB8.2050002@knipp.de> Subject: Re: Defining local IP address when opening connections to database Date: Wed, 7 Mar 2012 11:49:41 -0500 Message-ID: <03b601ccfc82$4badef60$e309ce20$@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHOBe5NviIg9eTgGzKrHnxrzck0iZZc99UQ Content-Language: en-us X-Pg-Spam-Score: -2.0 (--) X-Archive-Number: 201203/10 X-Sequence-Number: 22749 > -----Original Message----- > From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc- > owner@postgresql.org] On Behalf Of Michael Bauland > Sent: Wednesday, March 07, 2012 11:20 AM > To: pgsql-jdbc@postgresql.org > Subject: [JDBC] Defining local IP address when opening connections to > database > > Hi, > > 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? > > Cheers, > > Michael Are you missing the obvious, in which case read Kevin's and Dave's responses, or do you mean that on the "client" machine (i.e., the one using JDBC) you have multiple network adapters and only one of them is allowed to connect to the database? If the latter is the case I am not sure about JDBC but I would presume you could setup some form of routing table on your machine so that any traffic to the server IP address is forced to be routed through the appropriate network card. David J.