Issue
I got this error in compiling my Java code: org.gjt.mm.mysql.Driver.
Java mysql driver that added in my project structure: mariadb-java-client-2.5.4.jar
the version of mariadb is :10.3.21-MariaDB-2
OS: 5.4.0-kali3-amd64
Solution
The org.gjt.mm.mysql.Driver
is the legacy class name used to backward compatibility with the predecessor of Connector/J (and is present in old MySQL drivers), in new ones (8.0) the class name used is om.mysql.cj.jdbc.Driver
.
But, when we use the MariaDB driver superior to 1.2.0 (in your case 2.5.4) we need to use org.mariadb.jdbc.Driver
as class name.
Answered By - JuanMoreno
Answer Checked By - Willingham (JavaFixing Volunteer)