This is the Warning im getting in console, Im confused with this warning:
Loading class `com.mysql.jdbc.Driver\'.
This is deprecated. The new driver class is
The driver is automatically registered via SPI and manual loading of the driver class is usually unnecessary. Just change "com.mysql.cj.jdbc.Driver"
There important changes to the Connector/J API going from version 5.1 to 8.0. You might need to adjust your API calls accordingly if the version you are using falls above 5.1.
please visit MySQL on the following link for more information https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-api-changes.html
This warning also appears if you are using the log4jdbc-spring-boot-starter library directly.
However there is a config to choose the correct driver yourself. Put this in your application.properties
:
log4jdbc.drivers=com.mysql.cj.jdbc.Driver
log4jdbc.auto.load.popular.drivers=false
See documentation on Github
my solution: org.springframework.boot 2.0.5.RELEASE
Rather: org.springframework.boot 2.1.0.RELEASE
I'm using Eclipse and defined MySql connection pool in META_INF/context.xml. Part of its content is:
<Context>
<Resource name="..."
driverClassName="com.mysql.jdbc.Driver"
... />
</Context>
When I changed the line starting with "driverClassName" as follows, problem is gone.
driverClassName="com.mysql.cj.jdbc.Driver"
If you're using Hibernate then change in your "hibernate.cfg.xml" the following:
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
To:
<property name="hibernate.connection.driver_class">com.mysql.cj.jdbc.Driver</property>
That should do :)