CH的成长日记
使用JDBC连接MySQL时,报错:
Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is
com.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
修改连接数据库的语句(斜体字就是需要修改的地方):
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/db_mybatis2*?useUnicode=true&characterEncoding=UTF-8&userSSL=false&serverTimezone=GMT%2B8*
由于5.几的版本是:com.mysql.jdbc.Driver
而8.几的版本需要:com.mysql.cj.jdbc.Driver
url后面也需加上:?useUnicode=true&characterEncoding=UTF-8&userSSL=false&serverTimezone=GMT%2B8*