如果数据库里是乱码在写数据库前用以下方法转换一下:
public static String iso8859togbk(String strvalue) 

try{ 
if(strvalue==null) 
return null; 
else 

strvalue = new String(strvalue.getBytes("ISO8859_1"), "GBK"); 
return strvalue; 

}catch(Exception e){ 
return null; 

}  public static String iso8859togb2312(String strvalue) 

try{ 
if(strvalue==null) 
return null; 
else 

strvalue = new String(strvalue.getBytes("ISO8859_1"), "gb2312"); 
return strvalue; 

}catch(Exception e){ 
return null; 

}  public static String gb2312to8859(String strvalue) 

try{ 
if(strvalue==null) 
return null; 
else 

strvalue = new String(strvalue.getBytes("gb2312"), "ISO8859_1"); 
return strvalue; 

}catch(Exception e){ 
return null; 


public static String gbkto8859(String strvalue) 

try{ 
if(strvalue==null) 
return null; 
else 

strvalue = new String(strvalue.getBytes("gbk"), "ISO8859_1"); 
return strvalue; 

}catch(Exception e){ 
return null;