About "Loading class com.mysql.jdbc.Driver'. This is deprecated."

databases

(RAY.LV) #1

Hi,

When using MySql , the console will print some warning message like below:

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.

I have searched some information about that, found that ‘com.mysql.cj.jdbc.Driver’ is the driver of mysql 6.x,
Now my question is whether CUBA supports MySql 6.x ? If yes, how to do?

Thanks


(Daniil Tsaryov) #2

Hello @lugreen

CUBA supports MySQL 5.6+ . Have you encountered any problems?

Regards,
Daniil


(RAY.LV) #3

Hi, Daniil

Thanks for your reply timely.

In fact there’s no problem for me. Just a developer from Chinese forum asked this question. He want to use newer version mysql driver.

We are not sure about this , so i asked it here.

Regards
Ray.Lv


(Daniil Tsaryov) #4

com.mysql.cj.jdbc.Driver is a replacement for deprecated com.mysql.jdbc.Driver, so newer versions of MySQL should be correctly working.

You can find a usage of the first one in the official documentation of MySQL: link

Regards,
Daniil


(RAY.LV) #5

Hi,Daniil

At present ,CUBA used driver of mysdql is “com.mysql.jdbc.Driver” , so CUBA can’t support mysql 6.x+,
Am i right ?

Regards,
Ray.LV


(Daniil Tsaryov) #6

It seems that it should be clarified that MySQL public releases are:

  • 5.6
  • 5.7
  • 8.0

And in fact there is no 6.* MySQL releases.

MySQL 8 is supported in Release 8 of CUBA Studio: YouTrack.

Regards,
Daniil


(RAY.LV) #7

Hi,Daniil

Thanks a lot.
Now it’s clear.

Regards
Ray.LV


(4714407) #8

Driver classes “com.mysql.jdbc.Driver” used by platform is deprecated!


(Daniil Tsaryov) #9

Hello @4714407

Platform doesn’t use any specific version because MySQL drivers are not redistributable.

Could you describe you case in more details?

Regards,
Daniil


(4714407) #10

set driverClassName=“com.mysql.cj.jdbc.Driver” in context.xml