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

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

Hello @lugreen

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

Regards,
Daniil

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

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

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

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

Hi,Daniil

Thanks a lot.
Now it’s clear.

Regards
Ray.LV

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

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

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

1 Like