Util工具类 Clob转成String类型

/**
 * 将字Clob转成String类型
 * <p>
 * 2017年8月31日 15:24:48
 * xj
 *
 * @param sc clob对象
 * @return String
 * @throws SQLException
 * @throws IOException
 */
public static String ClobToString(Clob sc) throws SQLException, IOException {
    String reString = "";
    // 得到流
    Reader is = sc.getCharacterStream();
    BufferedReader br = new BufferedReader(is);
    String s = br.readLine();
    StringBuffer sb = new StringBuffer();
    // 执行循环将字符串全部取出付值给StringBuffer由StringBuffer转成STRING
    while (s != null) {
        sb.append(s);
        s = br.readLine();
    }
    reString = sb.toString();
    
    return reString;
}


更多工具类方法:http://blog.csdn.net/qq_34117825/article/details/78392976

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值