插入的时候是:
SQLstatement.executeUpdate(new String(query.getBytes(), "iso8859-1");
输出是:
SQLresult = SQLstatement.executeQuery(query); 
System.out.println(String(SQLresult.getBytes("name"),"gb2312") );

解决方案 »

  1.   

    在连接串中指定字符集和unicode编码
    Class.forName("org.gjt.mm.mysql.Driver").newInstance(); 
    String url ="jdbc:mysql://134.202.128.200/testdb?user=guest&password=123456&useUnicode=true&characterEncoding=gb2312"; 
    //testDB为你的数据库名 
    Connection conn= DriverManager.getConnection(url); 
    Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); 应该可以 搞得定的。这个问题过去我也遇到过
      

  2.   

    上面两种都可以的!建议把mysql的默认字符集设置为gbk