• Register
0 votes

Problem :

Facing following jdbc issue 

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

6 5 3
6,930 points

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://", "root", "root");

9 7 4
38,600 points

Related questions

0 votes
2 answers 227 views
Problem : I want my database to talk to my Java programs. I am getting following error message. Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The ... (); // ResultSet result = stat.executeQuery( "select * from table" ); System.out.println("Connected?"); } }
asked Dec 10, 2019 alecxe 7.5k points
0 votes
1 answer 10 views
Problem: I want to check if the very specific value already exists in the database. I am currently accessing database from the java standalone app using the JDBC my queries for inserting records into the db are working so my setup and the connection are perfectly fine. ... near 'd-f05708071f8f' at line 1 But if I attempt to execute above command in the MySQL command line then it works properly.
asked Aug 3 Raphael Pacheco 4.9k points
0 votes
1 answer 6 views
I need to know how to return multiple values from a function in Java.
asked Oct 3 Daniel Anderson 4k points
0 votes
1 answer 4 views
I am finding difficulty to show data in dropdownlist from database in PHP.
asked Oct 3 Daniel Anderson 4k points
0 votes
1 answer 11 views
I need to know how to update radio button value in database using PHP.
asked Sep 29 Daniel Anderson 4k points