目录
一、问题描述:
在xml文件中的mysql链接URL报错:The reference to entity "characterEncoding" must end with the ';' delimiter。
二、报错原因:
原因是在XML文件中,& 符号需要转义。
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/ssm_crud??serverTimezone=UTC&characterEncoding=utf8&useUnicode=true&useSSL=false"
userId="root"
password="root">
</jdbcConnection>
三、正确写法:
connectionURL="jdbc:mysql://localhost:3306/ssm_crud??serverTimezone=UTC&characterEncoding=utf8&useUnicode=true&useSSL=false"
四、其他:
在xml文件中有以下几类字符要进行转义替换: