问题
I'm using mysql-connector-java-5.1.6-bin with jdk 6 currently but I'm moving my project to jdk 8 do I need to download different version of this jar file?
回答1:
If you want use JDK 8, you need the latest version of mysql connector, Connector/J 8.0
From the What's New in Connector/J 8.0? page:
- It is a MySQL driver for the Java 8 platform. For Java 7 or earlier, use Connector/J 5.1 instead.
回答2:
You don't require Connector/J 8.0 to run on JRE 8. Connector/J 5.1 works too but 5.1 is getting much less maintenance effort these days.
Connector/J 5.1 works with JRE 1.5 and above, at least until Java breaks compatibility with these older bytecodes.
Connector/J 8.0 works with JRE 8.0 and above.
https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-versions.html
来源:https://stackoverflow.com/questions/48005857/do-i-need-different-version-of-mysql-connector-for-jdk-8