我的MYSQL数据库用GB2312编码,JSP是GB2312。我显示数据是写一个所自定义标签从数据库通过一个BEAN对数据库操作,于是写了这样一个方法。但是没用,请问正确的应该怎样写
public String trans(String arg){
String s = null;
try{
s = new String(arg.getBytes("iso-8859-1"),"gb2312");
}catch(Exception e){
System.out.print("编码错误");
}
return s;
}