1.版本不正确
在检查mysql-connector-java.jar包版本时我发现自己引入的是8.0.11版本的,网上都是5.x的,瞬间感觉不妙了,因为版本问题真的让人头大。
果不其然就是版本问题。
有两种解决方法:
1.退回到5.x版本,其他配置不变
2.修改jdbc.properties文件
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/AppStore?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true