MySQL Forums
Forum List  »  Connector/JDBC and Java

Re: Can you create a MySQL JDBC connection string that has different hosts but the same port?
Posted by: Filipe Silva
Date: October 09, 2017 11:46AM

This shouldn't be a problem.

Probably you are getting a timeout from your web server while waiting to establish a connection to the database. You should at least add the connection properties "socketTimeout=1000" and "retriesAllDown=3" or some other low values. The defaults are too high for the situation where no server is listening in any of the pointed ports; those would result endless waits and each server would be tested 120 times before actually failing to get a connection.

So, my guess is that you don't have any server listening in any of the hosts. If that's not the case, can you paste the stack trace from the error you're getting?

Options: ReplyQuote


Subject
Written By
Posted
Re: Can you create a MySQL JDBC connection string that has different hosts but the same port?
October 09, 2017 11:46AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.