要是用mysql就--jdbc:mysql://localhost:3306/mydatabase?useUnicode=true&characterEncoding=ISO8859_1--连数据库 

解决方案 »

  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)
    {
    }
    return "null";
    }或者在论坛里面搜索“中文”,就可以看到相关资料了
      

  2.   

    通过驱动weblogic sqlserver,利用jbuilder的querydataset查询从sqlserver数据库中读数据,在jdbtable中显示汉语为乱码。  请问,可不可以在使用驱动时设置来解决如何使用?
    或者通过querydataset或jdbtable先得到类型为string的列,再进行转换,如果可以,怎么做?或者有其它更好的办法,请高手们帮忙,万分感谢,情况紧急,敬请立刻答复。
      

  3.   

    大多数驱动得到或写入的数据都会是乱码
    得到String类型如String str后,如下转换即可:
    从数据库中读出后转:
    str=new String (str.getBytes("ISO-8859-1"),"gb2312");
    写入数据库前转:
    str=new String (str.getBytes("gb2312"),"ISO-8859-1");