1.通过sql直接转换

select CONVERT (*** USING utf8) AS userName from usertable;

2.通过程序转换(注:本例用的是springmvc包装并返回结果集)

String srt2;
   try {
         srt2 = new String((byte[])entry.getValue(),"UTF-8");
          hashmap.put(entry.getKey().toString(), srt2);
    } catch (UnsupportedEncodingException e) {
    e.printStackTrace();
   }

 

相关文章:

  • 2022-12-23
  • 2021-05-31
  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-22
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案