Question

While establishing JDBC connection.

  • 1 September 2022
  • 4 replies
  • 20 views

I am getting this type of error JDBC_00 - Cannot connect to specified database: com.mysql.cj.jdbc.exceptions.CommunicationsException. Can anybody help me in this.

 


4 replies

Userlevel 2
Badge

Hi @Akanksha,

This is an exception coming from MySQL driver, basically we are not able to establish the connection.

Quickly googling it, I’ve found this that might help you troubleshoot https://stackoverflow.com/questions/6865538/solving-a-communications-link-failure-with-jdbc-and-mysql

Actually, I tried everything but than also not able to establish connection. So could you please tell me, is there any other way to establish a JDBC connection.

Userlevel 2
Badge

Have you tried doing a ping to the machine where the MySQL is located? Are we sure it is reachable? (Not blocked by a firewall or things like that)

Its Resolved automatically. Thanks for helping @alex.sanchez .

Reply