配置文件里有编码这个属性的啊

解决方案 »

  1.   

    在hibernate.cfg.xml中应该这样写 <property name="connection.url">jdbc:mysql://localhost:3306/yidishui?useUnicode=true&amp;characterEncoding=UTF-8</property>如果用hibernate.properties
    #hibernate.connection.url jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8ps:处理中文的话,characterEncoding用GBK一样可以。
    但字节编码问题最好的解决方法还是统一使用UTF-8!!!