Skip to content

#1313 upgrade deprecated MySQL driver #1313

@sant0s

Description

@sant0s

Actual Behavior

Setting

db.driver=com.mysql.cj.jdbc.Driver

in application.conf

results in

Unexpected error : Unexpected Error, caused by exception UnsupportedOperationException: I do not know which hibernate dialect to use with com.mysql.cj.jdbc.Driver and I cannot guess it, use the property jpa.dialect in config file

and setting

jpa.dialect=org.hibernate.dialect.MySQL8Dialect

results in

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.

Play Version

1.5.3

Operating System

Ubuntu 18.04

JDK

Oracle 1.8.0_201-b09

Library Dependencies

MySQL driver JAR bundled with Play: mysql-connector-java 5.1.46

Expected Behavior

Play should load the Connector/J 8.0 MySQL driver when it finds

db.driver=com.mysql.cj.jdbc.Driver

in application.conf and recognise the correponding JPA dialect, regardless of whether it's declared in application.conf via

jpa.dialect=org.hibernate.dialect.MySQL8Dialect

No warning message should be issued.

Connector/J 8.0 (mysql-connector-java 8.0.17) provides compatibility with all the functionality of MySQL 5.6, 5.7, and 8.0.

https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-versions.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions