在XML文件中配置數據庫的連接,復制
<property name="connection.url">jdbc:mysql://localhost:3306/test?serverTimezone=UTC&characterEncoding=utf-8</property>
報錯誤:The reference to entity "characterEncoding" must end with the ';' delimiter.
原來是XML中需要將 “&”轉義“&”
上述代碼改
<property name="connection.url">jdbc:mysql://localhost:3306/test?serverTimezone=UTC&characterEncoding=utf-8</property>
錯誤消失!