Issue
Ping Connection Pool failed for MySQL Pool. Connection could not be allocated because: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. Please check the server.log for more details.
Solution
I just want to give solution here as I already read and view many solutions regarding this error but not anyone of them is good for me.
So please follow the step by step process:-
- Download and Install Glassfish/Payara Server.
- Download and Install latest mysql.
- Install it as full and in mysql folder you can find an Connector j folder.
from there copy the executable jar file and paste it into two folders.
- glassfish5\glassfish\lib
- glassfish5\glassfish\domains\domain1\lib
- Now restart the server from netbeans.
Open admin console and then goto JDBC and then select jdbc connection pool
Add particular property :-
- Database name
- Password
- port :- 3306
- ServerName :- localhost
- Url :-jdbc:mysql://localhost:3306/test
- User 6.Enable ping
- save
Best of luck
Answered By - yash Pandey