我安装了 JDK 1.7 并尝试连接到不同的 MySQL 数据库和 Connector/J 版本。但是每次加载驱动程序时都会出现以下错误:
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at jdbc.JDBC.main(JDBC.java:24)
Caused by: java.lang.RuntimeException: Uncompilable source code - com.mysql.jdbc.NonRegisteringDriver is not abstract and does not override abstract method getParentLogger() in java.sql.Driver
at com.mysql.jdbc.NonRegisteringDriver.<clinit>(NonRegisteringDriver.java:69)
... 3 more
哪个 MySQL 驱动程序版本与 JDK 1.7 兼容?