欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

8.Clob类型字段转String

程序员文章站 2022-06-18 19:51:12
...
public String clobToString(Clob clob) throws SQLException {
    String reString = "";
    Reader reader = clob.getCharacterStream();
    BufferedReader br = new BufferedReader(reader);
    String s = br.readLine();
    StringBuffer sb = new StringBuffer();
    while(s != null){
        sb.append(s);
        s = br.readLine();        
    }
    reString = sb.toString();
    return reString;
}