"“loading class com.mysql.jdbc.driver … is deprecated” message" Code Answer

1

it isn't an error; it is a warning (or advisory) message resulting from a

class.forname("com.mysql.jdbc.driver")

call. your code continues to run despite the message.

it is mainly telling you that the name of the driver class has changed to com.mysql.cj.jdbc.driver. so, instead use:

class.forname("com.mysql.cj.jdbc.driver")

it is also letting you know that since java 6 (jdbc 4.0) it is usually not necessary to manually load the driver class using class.forname anyway, because jdbc is now able to load the correct driver itself (provided that the driver .jar is available on the class path).

By Wjdavis5 on March 29 2022

Answers related to ““loading class com.mysql.jdbc.driver … is deprecated” message”

Only authorized users can answer the Search term. Please sign in first, or register a free account.