I have a web application that should pull data from a localhost database. I am using Severlets and mysql jdbc, eclipseLink. The problem is when I deploy the application it gives me the following error, even though i have created the database connection which works fine and added the latest mysql (8.0.16) jar to the library.
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services -
2.7.0.v20170811-d680af5):
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: No suitable driver found for
jdbc:mysql://localhost:3306/sampledb?zeroDateTimeBehavior=convertToNull
Error Code: 0
I have also done a clean installation of netbeans 8.2 and java and the error still persist. But I am using two different PC and it is the same problem. For some reason i think netbeans has a bug. I am using glassfish as my server which works fine.
Here is a link yo my project structure: https://res.cloudinary.com/dpsotxezr/image/upload/v1557082088/structure_2_migcvz.png
I also get this error when manually trying to connect to mysql server
mysqld: File '.\binlog.index' not found (OS errno 13 - Permission denied)
2019-05-05T18:51:07.133050Z 0 [System] [MY-010116] [Server] C:\Program
Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.16) starting as
process 1796
2019-05-05T18:51:09.509588Z 0 [Warning] [MY-010091] [Server] Can't create
test file C:\Program Files\MySQL\MySQL Server 8.0\data\LAPTOP-
43BL4A79.lower-test
2019-05-05T18:51:09.510028Z 0 [Warning] [MY-010091] [Server] Can't create
test file C:\Program Files\MySQL\MySQL Server 8.0\data\LAPTOP-
43BL4A79.lower-test
2019-05-05T18:51:10.672870Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-05-05T18:51:12.306701Z 0 [System] [MY-010910] [Server] C:\Program
Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld
8.0.16) MySQL Community Server - GPL.
- So i have added the latest mysql driver to the project library
- I have also tried Class.forName("com.mysql.jdbc.Driver"); but still dont work
- Glassfish says there is no suitable driver.
PLEASE HELP, I have been trying to fix this problem for over a week now and related problems solutions on this site dont seem help.