不是。
应该是需要进行编码转化:
iso8859-1---------------gb2312

解决方案 »

  1.   

    连接数据库的url换成
    jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=GB2312
      

  2.   

    要进行转换:如:
    String name;
      name= new String(request.getParameter("name").getBytes("gb2312"),"ISO8859_1");一般都OK了;
      

  3.   

    public class Omnibus { 
    public  static String UnicodeToChinese(String s){
      try{
      if(s==null || s.equals(""))return "";
      String newstring=null;
      newstring= new String(s.getBytes("ISO8859_1"),"gb2312");
      return newstring;
      }
      catch(UnsupportedEncodingException e){
      return s;
      }
      }
      public static String ChineseToUnicode(String s){
      try{
      if(s==null || s.equals(""))return "";
      String newstring=null;
      newstring= new String(s.getBytes("gb2312"),"ISO8859_1");
      return newstring;
      }
      catch(UnsupportedEncodingException e){
      return s;
      }
      }
    }
      

  4.   

    将汉字写入库中的时候,MYSQL是会自动转码的,好像是转成encode码了,你需要:
    String name=new String(username.getBytes("gb2312"),"ISO8859_1");
      

  5.   

    换最新版本的JDBC驱动就可以不需要手工转码
      

  6.   

    你可以在你的JSP文件中加上下面这个函数,再在需要输入中文的地方调用这个函数就可以了
    public String toChinese(String str){
        if(str==null){
        str  ="" ;
        }
        else{
            try {
           str = new String(str.getBytes("iso-8859-1"),"gb2312") ;
            }
            catch (Exception ex) {
            }
        }
        return str ;
     }
    例如:String ABC=toChinese(request.getParameter("ABC"));