om.mysql.jdbc.Driver 是 mysql-connector-java 5中的,
com.mysql.cj.jdbc.Driver 是 mysql-connector-java 6中的
1、JDBC连接Mysql5 com.mysql.jdbc.Driver:
driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false
username=root
password=
2、JDBC连接Mysql6 com.mysql.cj.jdbc.Driver, 需要指定时区serverTimezone:
driverClassName=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false
username=root
password=
原文链接:https://blog.csdn.net/superdangbo/java/article/details/78732700