Re: Fail-over PG server in connection string - syntax ?

From: Chen Huajun <chenhj(at)cn(dot)fujitsu(dot)com>
To: Mistina Michal <Michal(dot)Mistina(at)virte(dot)sk>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Fail-over PG server in connection string - syntax ?
Date: 2013-07-23 06:23:21
Message-ID: 51EE2159.8000109@cn.fujitsu.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Sven Holcombe 2013-07-23 18:41:25 Unpack an org.postgresql.geometric.PGpoint
Previous Message Mistina Michal 2013-07-22 15:35:45 Fail-over PG server in connection string - syntax ?