Re: JDBC connectivity issue

2018-03-23 Thread JCMS22
I am surprised this was not answered correct yet.

I am in the same bucket as you and here is the problem. A quick look at the
code and you find the answer.

The BaseDataSource class (from which PGSimpleDataSource inherits) does NOT
support failover addresses. The underlying driver used to parse the URL does
it correctly: it returns url1,url2,url3 for URL and port1,port2,port3 for
ports. However, the datasource interprets this as a single address so it
tries to convert the "port1,port2,port3" string to an Integerand it
crashes.



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html



Re: JDBC connectivity issue

2018-03-23 Thread JCMS22
I forgot to say I am trying to investigate how to make it work as we need
specific stuff from the DataSource object. 

It might work if you use setServerName rather than setUrl. setServerName
will append itself the jdbc:postgresql:// so you only give it the server
name (i.e "url1:port1,url2:port2") and then setPortNumber to 0. By reading
the code, this might work.



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html