useUnicode=true&characterEncoding=gb2312是不是定义使用用户指定字符集,以及用户指定字符集类型。
如果没有useUnicode=true就表示不使用用户指定字符集,指定也是无效!

解决方案 »

  1.   

    mysql 不支持 unicode,将 connectionString 设置成 encoding 为 gb2312
      

  2.   

    不加“useUnicode=true”会不会有问题,我在这个页面只是做查询
      

  3.   

    在jsp中输出是乱码console输出正常
      

  4.   

    假如这样:
    如果我数据库中有“姓名”这条记录,不加“useUnicode=true”
    select password from user where username = "姓名";会不会查出来呢?
      

  5.   

    mysql 不支持 unicode,所以比较麻烦。将 connectionString 设置成 encoding 为 gb2312
      String connectionString = "jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=gb2312";