配置JNDI 报错 The reference to entity "characterEncoding" must end with the ';' delimiter

url="jdbc:mysql://localhost:3306/test?useUnicode=true;characterEncoding=utf-8" />
</Context>
或者:
<property name="connection.url">jdbc:sqlserver://localhost:1433?useUnicode=true&characterEncoding=UTF-8</property>

上边这种类型的配置方式 会报The reference to entity "characterEncoding" must end with the ';' delimiter 这个错误。

这是由xml文件中的编码规则决定要这么变换。

在xml文件中有以下几类字符要进行转义替换:

&lt;
<
小于号

&gt;
>
大于号

&amp;
&


&apos;
'
单引号

&quot;
"
双引号


正确的配置为:

url="jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=utf-8" />
</Context>

或者:
<property name="connection.url">jdbc:sqlserver://localhost:1433?useUnicode=true&amp;characterEncoding=UTF-8</property>
原文地址:https://www.cnblogs.com/cyy-13/p/5806288.html