Recently I have been working on a Java Web Application with JDBC and I have found that com.mysql.jdbc.Driver
is deprecated since "Connector/J API 8.0".
Therefore as shown below, the Java Runtime warns you to use com.mysql.cj.jdbc.Driver
, instead of using the deprecated driver.
Loading class `com.mysql.jdbc.Driver'. This is deprecated.
The new driver class is `com.mysql.cj.jdbc.Driver'.
The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
What my problem is really lies under this line.
The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
At first, I have thought this means it is not required to call Class.forName
to register the driver, but after testing out, I have found that I was wrong.
So what is actually mean by manual loading of the driver class is generally unnecessary
? Is there something that I have missed?
Thank you.