项目场景:
在Mybatis的学习过程中,将xml文件中写死的数据库配置改用properties文件的方式时,出现错误
问题描述:
properties中的代码:jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/new_connection?useSSL=false&serverTimezone=UTC
jdbc.user=root
jdbc.passwd=123456
}
之后程序报错
Malformed database URL, failed to parse the connection string near ‘;serverTimezone=UTC’.
原因分析:
版本为8.0.18 在java和xml中,&都要使用&
而properties中因为部分符号无法编译
解决方案:
解决:将&; 换成&