先把gb2312转换成ISO-0891,再入库

解决方案 »

  1.   

    要做一下转码,如下String str="中国人";
    str=new String(str.getString("iso8859-1"),"GB2312");
      

  2.   

    你的程序涉及到jsp吗
    如果有
    请在页面加入
    <%@page contentType="text/html;charset=gb2312"%>
    r然后在有中文的地方进行转码,用楼上的方法
    如果仅仅是访问数据库
    可以在getConnection中使用编码控制
    DriverManager.getConnection("yoururl&useUnicode=true&characterEncoding=gb2312")
      

  3.   

    谢谢~~转换时还要加上try/catch