Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYm4r-00Dxyx-Iy for pgsql-jdbc@arkaria.postgresql.org; Tue, 30 Jul 2024 12:35:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sYm4p-009QoG-Qu for pgsql-jdbc@arkaria.postgresql.org; Tue, 30 Jul 2024 12:35:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYm4o-009Qo0-B5 for pgsql-jdbc@lists.postgresql.org; Tue, 30 Jul 2024 12:35:39 +0000 Received: from fout8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYm4k-002CwS-Hz for pgsql-jdbc@lists.postgresql.org; Tue, 30 Jul 2024 12:35:37 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.nyi.internal (Postfix) with ESMTP id 75BDE138070A for ; Tue, 30 Jul 2024 08:35:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 30 Jul 2024 08:35:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renaghan.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1722342932; x=1722429332; bh=dci3SF16RS QNWDDOm6AQhTDMWCgFfayIBL2QXzaOsEc=; b=axb+Ee/l+zQRgCwWILqWFjkiAh SAgl65lnovZ2MXQnZd4Ly483zXMdZdsAkIY0lwHvtwSpBX3rnM0ZJLkKgKVv2fG0 wXvXeftQgNVh4eDSbSMwtRMGYKn/SX5MPdJFTY7vlXZMXHoJ4AqU/iZfPWSEyewa /FExhZPNKFD6fUUwL1Cp81MGxlnl8EkyYsfS+Rl+bPjt4O+DmSVRg5x/NMdGKOSk qWxM0hveTgKTucZOiascs8xI9kRTD8xiARQW/aWAOgYHaO6ktMRit6VUcyFKqCMU M0rIQzdQzgsSYRL0wTpCqrceKAFHzKGOL+ynSlruymGJtgu1CNticWZg+yvg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1722342932; x=1722429332; bh=dci3SF16RSQNWDDOm6AQhTDMWCgF fayIBL2QXzaOsEc=; b=JcKdDMnhIvd6Qr7JfmyDE03PTLDZDbFxb8glnH/71tfc K7CWEyuKAg5e/aFL258m/8AbnfO2uc+GfBBb1fAxtBRY1nVULvzZxm/ZdVrIXWIY QoBnYPCgFpfoWoNegjQulU2vBl4M/o91XKefcwvhjyCkD/crov0unVzDViEFAGkt yRX2BadckmUx1WulFI9HNkxI/k4Jc9I3A9Ggd4U8iTJ1OV8le4GvktzM77lJU/4m GIULAGSLml5PSwXg7TFf02mO2dZ0dniEccGkf+sNBpp95lB5rE7mwkgdtKQipfZv WM7p0yKcFIPtar7KkMSorafiKi/RYkcdlnxjauwUjw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrjeeggdehgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffoffkjghfgggtsegrtdhmre ertdejnecuhfhrohhmpefrrggurhgrihgtucftvghnrghghhgrnhcuoehprggurhgrihgt sehrvghnrghghhgrnhdrtghomheqnecuggftrfgrthhtvghrnhepleeludeuiefhueehff eifeeuveejjeelkeduhfdvtdefvdetlefhveektdejieeknecuffhomhgrihhnpehpohhs thhgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehprggurhgrihgtsehrvghnrghghhgrnhdrtghomhdpnhgspghrtghp thhtoheptd X-ME-Proxy: Feedback-ID: ibc4840b4:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 30 Jul 2024 08:35:32 -0400 (EDT) From: Padraic Renaghan To: pgsql-jdbc@lists.postgresql.org Subject: Re: jdbc connection multiple host Date: Tue, 30 Jul 2024 08:35:31 -0400 X-Mailer: MailMate (1.14r5964) Message-ID: <6BC75F21-E09C-43AE-8878-8321EA9ADB7A@renaghan.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_BCD7059A-2BE8-4EEA-82F6-7A03DBE07778_=" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=_MailMate_BCD7059A-2BE8-4EEA-82F6-7A03DBE07778_= Content-Type: text/plain; format=flowed; markup=markdown See info here at bottom of [this page](https://jdbc.postgresql.org/documentation/use/#connection-fail-over) > From: James Pang > Subject: jdbc connection multiple host > Date: 2024-07-30 08:28 EDT > > We plan to migrate Oracle to Postgresql databases. Application put > multiple host:ip in connection string, > jdbc://host1ip:port,host2:port/dbname , when host1 is accessible, it's > preferred. when host1 is not accessible, host2:port is secondary. > how to do that through Postgresql JDBC driver ? > > Thanks, > > James --=_MailMate_BCD7059A-2BE8-4EEA-82F6-7A03DBE07778_= Content-Type: text/html Content-Transfer-Encoding: quoted-printable

See info here at bottom of this page

From: James Pang jamespang886@gmail.com
Subject: jdbc connection multiple host
Date: 2024-07-30 08:28 EDT

We plan to migrate Oracle to Postgresql databases. Applic= ation put
multiple host:ip in connection string,
jdbc://host1ip:port,host2:port/dbname , when host1 is accessible, it's preferred. when host1 is not accessible, host2:port is secondary.
how to do that through Postgresql JDBC driver ?

Thanks,

James

--=_MailMate_BCD7059A-2BE8-4EEA-82F6-7A03DBE07778_=--