pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chen Huajun <chenhj@cn.fujitsu.com>
To: Mistina Michal <Michal.Mistina@virte.sk>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: Fail-over PG server in connection string - syntax ?
Date: Tue, 23 Jul 2013 14:23:21 +0800
Message-ID: <51EE2159.8000109@cn.fujitsu.com> (raw)
In-Reply-To: <4da286cd15324df59679fa18960e58d3@Electra.virte.intra>
References: <4da286cd15324df59679fa18960e58d3@Electra.virte.intra>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

hi Michal,


 >What is the correct syntax for building connection string? Should the fail-over within postgres-jdbc driver work?

The correct syntax is as the following
jdbc:postgresql://host1:port1,host2:port2/test


 >                  String connectionString = "jdbc:postgresql://pgsqldc1:5432/test,pgsqldc2:5432/test";

In the above sample,the correct connection string should looks like that

String connectionString = "jdbc:postgresql://pgsqldc1:5432,pgsqldc2:5432/test";


Best regards,
Chen Huajun





-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (2+ messages)

Message-ID: <51EE2159.8000109@cn.fujitsu.com>
Permalink:  ../51EE2159.8000109@cn.fujitsu.com/
Also on:    postgresql.org/message-id/51EE2159.8000109@cn.fujitsu.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: chenhj@cn.fujitsu.com, Michal.Mistina@virte.sk
  Subject: Re: Fail-over PG server in connection string - syntax ?
  In-Reply-To: <51EE2159.8000109@cn.fujitsu.com>
  References: <4da286cd15324df59679fa18960e58d3@Electra.virte.intra> <51EE2159.8000109@cn.fujitsu.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox