首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

hibernate中配置mysql url(使用中文)的有关问题

2011-12-12 
hibernate中配置mysql url(使用中文)的问题配置如下:property nameconnection.urljdbc:mysql://local

hibernate中配置mysql url(使用中文)的问题
配置如下:
<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后加上';'也不起作用。

[解决办法]
jdbc:mysql://localhost:3306/sc?useUnicode=true&amp;characterEncoding=UTF-8

这样写试试
[解决办法]
ls说的没错,&在html或者xml里使用&amp;表示的,否则xml文件本身都会出错。
[解决办法]
你也可以这样写,设置为不可以解析
<![CDATA[jdbc:mysql://localhost/sc?useUnicode=true&characterEncoding=UTF-8]]>
[解决办法]
jdbc:mysql://localhost:3306/sc?useUnicode=true&amp;characterEncoding=UTF-8

热点排行