Postgresql中invalid byte sequence for encoding \"UTF8\": 0x00".

由于目前Postgresql中官方解释Postgresql对于0x00和\u0000无法支持,必须进行替换。
在java中尝试程序将SQLServer程序导入到Postgreslq中时,发生上述问题,解决办法是:

 public String transfer0x00(String str){
        if(str !=null && str.indexOf(0x00) > -1){
            str = str.replace((char)0x00,' ');
        }
        return str;
    }

完成转换,经测试,能够解决这个问题。

你可能感兴趣的:(Postgresql,Java)