Documentation Home
MySQL Connector/J Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 1.2Mb
PDF (A4) - 1.2Mb


4.4.1.3 Changes in the Connector/J API

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 from com.mysql.jdbc.Driver to com.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 to com.mysql.cj.exceptions.ExceptionInterceptor

    • StatementInterceptor: from com.mysql.jdbc.StatementInterceptorV2 to com.mysql.cj.interceptors.QueryInterceptor

    • ConnectionLifecycleInterceptor: from com.mysql.jdbc.ConnectionLifecycleInterceptor to com.mysql.cj.jdbc.interceptors.ConnectionLifecycleInterceptor

    • AuthenticationPlugin: from com.mysql.jdbc.AuthenticationPlugin to com.mysql.cj.protocol.AuthenticationPlugin

    • BalanceStrategy: from com.mysql.jdbc.BalanceStrategy to com.mysql.cj.jdbc.ha.BalanceStrategy

    • MysqlDataSource: from com.mysql.jdbc.jdbc2.optional.MysqlDataSource to com.mysql.cj.jdbc.MysqlDataSource

    • MysqlDataSourceFactory: from com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory to com.mysql.cj.jdbc.MysqlDataSourceFactory

    • MysqlConnectionPoolDataSource: from com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource to com.mysql.cj.jdbc.MysqlConnectionPoolDataSource

    • MysqlXADataSource: from com.mysql.jdbc.jdbc2.optional.MysqlXADataSource to com.mysql.cj.jdbc.MysqlXADataSource

    • MysqlXid: from com.mysql.jdbc.jdbc2.optional.MysqlXid to com.mysql.cj.jdbc.MysqlXid