• Register
0 votes
114 views

Problem :

Facing following jdbc issue 

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

6 5 3
6,930 points

Please log in or register to answer this question.

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");

9 7 4
38,600 points

Related questions

0 votes
2 answers 300 views
300 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 19 views
19 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, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 21 views
21 views
I need to know how to return multiple values from a function in Java.
asked Oct 3, 2020 Daniel Anderson 4k points
0 votes
1 answer 13 views
13 views
I am finding difficulty to show data in dropdownlist from database in PHP.
asked Oct 3, 2020 Daniel Anderson 4k points
0 votes
1 answer 19 views
19 views
I need to know how to update radio button value in database using PHP.
asked Sep 29, 2020 Daniel Anderson 4k points
0 votes
1 answer 11 views
11 views
We need the data to go to the first drop-down list how can we do it with the help of PHP.
asked Sep 28, 2020 Daniel Anderson 4k points
0 votes
1 answer 28 views
28 views
How can i can pass data between view and controller. any one here guide me ?
asked Sep 26, 2020 Daniel Anderson 4k points
0 votes
1 answer 4 views
4 views
Basically we are trying at the time of registering users in a database table, we need to ensure that every user's email address or username is unique.
asked Sep 26, 2020 Daniel Anderson 4k points
0 votes
1 answer 20 views
20 views
I need to know how to get value of radio button in PHP from database. can some programmer from kodlogs help me sort out this issue?
asked Sep 25, 2020 Daniel Anderson 4k points
0 votes
1 answer 16 views
16 views
I need assistance in javascript variable value. specificalli i am seeking for passing the variables within the same page.
asked Sep 14, 2020 Daniel Anderson 4k points