ms sql 2000的驱动支持gb2312编码,但连ms sqlserver 7.0好象不行

解决方案 »

  1.   

    <%! //处理中文问题的自定义函数
    public String getStr(String str)
    {
    try
    {
    String temp_p=str;
    byte[] temp_t=temp_p.getBytes("ISO8859-1");
    String temp=new String(temp_t);
    return temp;
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    return "null";
    }
    %>        
    <%!//处理中文问题的自定义函数
    public String getStr2(String str)
    {
    try
    {
    String temp_p=str;
    byte[] temp_t=temp_p.getBytes("GBK");
    String temp=new String(temp_t,"ISO8859_1");
    return temp;
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    return "null";
    }
    %>  
    这是别人写的函数,试试吧.
      

  2.   

    <%! //处理中文问题的自定义函数
    public String getStr(String str)
    {
    try
    {
    String temp_p=str;
    byte[] temp_t=temp_p.getBytes("ISO8859-1");
    String temp=new String(temp_t);
    return temp;
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    return "null";
    }
    %>        
    <%!//处理中文问题的自定义函数
    public String getStr2(String str)
    {
    try
    {
    String temp_p=str;
    byte[] temp_t=temp_p.getBytes("GBK");
    String temp=new String(temp_t,"ISO8859_1");
    return temp;
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    return "null";
    }
    %>  
    这是别人写的函数,试试吧.
      

  3.   

    错,向数据库中写入数据时应该调用该函数。
    而从数据库中读出数据时不应该调用该函数
    而是在jsp叶面中引入中文的字符集。
      

  4.   

    我的jsp 页面是gb2312的,我使用jdbcodbc的时候完全正常,现在我的整个站点程序都开发完成了。mssqlserverJdbc里面有没有什么参数或者方法来设定起编码方式?