配置如下:
<property name="connection.url">
jdbc:mysql://localhost/sc?useUnicode=true&characterEncoding=UTF-8
</property>
这个url在jdbc中使用是没有问题的,但在hibernate中却不能通过,eclipse报出"The reference to entity "characterEncoding" must end with the ';' delimiter"的错误,为什么?我在characterEncoding后加上';'也不起作用。

解决方案 »

  1.   

    jdbc:mysql://localhost:3306/sc?useUnicode=true&amp;characterEncoding=UTF-8这样写试试
      

  2.   

    ls说的没错,&在html或者xml里使用&amp;表示的,否则xml文件本身都会出错。
      

  3.   

    你也可以这样写,设置为不可以解析
    <![CDATA[jdbc:mysql://localhost/sc?useUnicode=true&characterEncoding=UTF-8]]>
      

  4.   

    支持这种。不是不可解析,而是<![CDATA[  ]]>括起来的都算作是文本。
      

  5.   

    jdbc:mysql://localhost:3306/sc?useUnicode=true&amp;characterEncoding=UTF-8