This section describes some of the more important changes to the Connector/J API going from version 5.1 to 8.0 and beyond. You might need to adjust your API calls accordingly:
The name of the class that implements
java.sql.Driver
in MySQL Connector/J has changed fromcom.mysql.jdbc.Driver
tocom.mysql.cj.jdbc.Driver
. The old class name has been deprecated.-
The names of these commonly-used classes and interfaces have also been changed:
ExceptionInterceptor: from
com.mysql.jdbc.ExceptionInterceptor
tocom.mysql.cj.exceptions.ExceptionInterceptor
StatementInterceptor: from
com.mysql.jdbc.StatementInterceptorV2
tocom.mysql.cj.interceptors.QueryInterceptor
ConnectionLifecycleInterceptor: from
com.mysql.jdbc.ConnectionLifecycleInterceptor
tocom.mysql.cj.jdbc.interceptors.ConnectionLifecycleInterceptor
AuthenticationPlugin: from
com.mysql.jdbc.AuthenticationPlugin
tocom.mysql.cj.protocol.AuthenticationPlugin
BalanceStrategy: from
com.mysql.jdbc.BalanceStrategy
tocom.mysql.cj.jdbc.ha.BalanceStrategy
MysqlDataSource: from
com.mysql.jdbc.jdbc2.optional.MysqlDataSource
tocom.mysql.cj.jdbc.MysqlDataSource
MysqlDataSourceFactory: from
com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory
tocom.mysql.cj.jdbc.MysqlDataSourceFactory
MysqlConnectionPoolDataSource: from
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
tocom.mysql.cj.jdbc.MysqlConnectionPoolDataSource
MysqlXADataSource: from
com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
tocom.mysql.cj.jdbc.MysqlXADataSource
MysqlXid: from
com.mysql.jdbc.jdbc2.optional.MysqlXid
tocom.mysql.cj.jdbc.MysqlXid