1.經過sql直接轉換html
select CONVERT (*** USING utf8) AS userName from usertable;spring
2.經過程序轉換(注:本例用的是springmvc包裝並返回結果集)sql
String srt2;
try {
srt2 = new String((byte[])entry.getValue(),"UTF-8");
hashmap.put(entry.getKey().toString(), srt2);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}mvc