我们也遇到过同样的问题,后来都不用PreparedStatement了,全改成sql语句然后转换编码解决了。不过你可以试试转换“中国”的编码,多试几次,祝你好运。

解决方案 »

  1.   

    private String getChinese(String temp){
       try{
         byte[] tempByteArray = temp.getBytes("GB2312");
         return new String(tempByteArray, 0, tempByteArray.length);
       }catch(Exception e){
         return null;
       }
      }
    这个方法我尝试了,不行,将GB2312换成ISO8859-1都不行
      

  2.   

    String temp = "中国";
    String newStr = New String(temp.getBytes("GB2312",ISO8859-1));
    PreparedStatement.setString(1,newStr);
      

  3.   

    跟jdbc驱动和数据库支持的CharSet有关系