0

How does Java application connect to multi master replicated MySQL Database?

I am using com.mysql.jdbc.ReplicationDriver

but this is giving exception as:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure  
Prophet
  • 32,350
  • 22
  • 54
  • 79
Dev
  • 19
  • 5
  • Please read this, I hope it helps: http://stackoverflow.com/questions/2983248/com-mysql-jdbc-exceptions-jdbc4-communicationsexception-communications-link-fai – SaintLike Jun 18 '14 at 10:54
  • My JDBC URL is String JDBC_URL = "jdbc:mysql:replication://address=(host=localhost)(port=3308)(type=master)," + "address=(host=localhost)(port=3306)(type=master)"; – Dev Jun 18 '14 at 10:57
  • This is having multi paster only...on a single machine (localhost) – Dev Jun 18 '14 at 10:58

1 Answers1

0

Have you read the thread I've sent you in the comments of your question? Didn't help? Try this tutorial on creating a step-by-step MySQL+JDBC tutorial

Tutorial

I hope it helps

Community
  • 1
  • 1
SaintLike
  • 9,119
  • 11
  • 39
  • 69