<set-property property="url"
value="jdbc:mysql://localhost:3306/gxart_education?useUnicode=true&characterEncoding=GBK"/>
</data-source> 

解决方案 »

  1.   

    修改这些就行,试试:
    <set-property property="url" 
    value="jdbc:mysql://localhost:3306/gxart_education?useUnicode=true&characterEncoding=GBK"/> 
    </data-source> 
      

  2.   

    这么改不行啊。报错“the reference to entity"characterEncoding" must end with the ';'delimiter”
    而我在最后面加个分号也是错。还有没有别的好办法?请指点。急啊。
      

  3.   


    <set-property property="url" 
    value="jdbc:mysql://localhost:3306/gxart_education?useUnicode=true&amp;characterEncoding=GBK"/> 
    </data-source> 
      

  4.   

    这个好像应该改数据库客户端的访问字符集,文件名好像叫My.ini ... 
      

  5.   

    启动时设置中文字符集:
    mysqld --default-character-set=utf8
      

  6.   

    也可以在web.xml中加过滤器
    <filter>
    <filter-name>EncodingFilter</filter-name>
    <filter-class>filters.SetCharacterEncodingFilter</filter-class>
    <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
    </init-param>
    </filter> <filter-mapping>
    <filter-name>EncodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
      

  7.   

    <set-property property="url"  
    value="jdbc:mysql://localhost:3306/gxart_education?useUnicode=true&amp;characterEncoding=GBK"/>  
    </data-source>  
    正解
    还有
    你的中文字段最好也用GBK编码
    不要轻易改my.ini,会影响其他项目对数据库的使用。