You need to load the com.mysql.jdbc.Driver
driver class.
private static final String DRIVER_NAME="com.mysql.jdbc.Driver";
Look at the official documentation:
The name of the class that implements java.sql.Driver in MySQL Connector/J is com.mysql.jdbc.Driver. The org.gjt.mm.mysql.Driver class name is also usable for backward compatibility with MM.MySQL, the predecessor of Connector/J. Use this class name when registering the driver, or when otherwise configuring software to use MySQL Connector/J.
0
solved Why am I getting “No suitable driver found for jdbc:mysql://localhost:3306/test2”?