mvnrepository
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.26</version>
</dependency>
datasource
增加serverTimezone 和 allowPublicKeyRetrieval
&serverTimezone=UTC&allowPublicKeyRetrieval=true
url: jdbc:mysql://localhost:3306/db?createDatabaseIfNotExist=true&
characterEncoding=utf8&allowMultiQueries=true&useSSL=false&
zeroDateTimeBehavior=convertToNull&
serverTimezone=UTC&allowPublicKeyRetrieval=true
driver-class-name
driverClassName: com.mysql.jdbc.Driver
driver-class-name: com.mysql.cj.jdbc.Driver
Java代码
StringUtils
com.mysql.jdbc.StringUtils
import com.mysql.cj.util.StringUtils;