报错信息
Caused by: org.dom4j.DocumentException: Error on line 13 of document : 对实体 "rewriteBatchedStatements" 的引用必须以 ';' 分隔符结尾。 Nested exception: 对实体 "rewriteBatchedStatements" 的引用必须以 ';' 分隔符结尾。
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2088)
... 27 more
解答:
以xml格式传递数据,当带有&符号时,需要转义,转成&
将&转义 &
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- set global time_zone='+8:00'; &serverTimezone=Asia/Shanghai webservice以xml格式传递数据,当带有&符号时,需要转义,转成& -->
<!-- <property name="connection.url">jdbc:mysql://localhost:3306/hibernate5?characterEncoding=utf8</property> -->
<property name="connection.url">jdbc:mysql://localhost:3306/hibernate5?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai&allowMultiQueries=true</property>