Programmers learn & share
0 votes
73 views

Problem :

Facing following jdbc issue 

caused by: com.mysql.jdbc.exceptions.jdbc4.communicationsexception: communications link failure

by (6.9k points)  
edited by | 73 views

1 Answer

0 votes

Solution :

Please find below best solution for your problem,

 Connection con = DriverManager.getConnection(
 "jdbc:mysql://localhost:3306/DBname", "root", "root");

Now replace the Localhost with your IP address
 Connection con = DriverManager.getConnection(
 "jdbc:mysql://192.0.0.000:3306/DBname", "root", "root");

by (36.1k points)  
2,204 questions
2,607 answers
59 comments
241 users