Clob转字符串

版权声明:内容记录学习过成文章,仅供参考 https://blog.csdn.net/qq_40195958/article/details/84378642

通过流进行读取Clob数据,转字符串返回

   public static String clobToString(Clob clob) throws Exception{
        StringBuffer reString = new StringBuffer();
            Reader is = clob.getCharacterStream();
            BufferedReader br = new BufferedReader(is);
            String re = br.readLine();
            while(re != null){
                reString.append(re);
                re = br.readLine();
            }
            br.close();
        return reString.toString();
    }

猜你喜欢

转载自blog.csdn.net/qq_40195958/article/details/84378642