设为首页 加入收藏

TOP

将Clob对象转换成String对象
2015-11-21 01:04:38 来源: 作者: 【 】 浏览:1
Tags:Clob 对象 换成 String
/**
	 * 将Clob对象转换成String对象
	 * @param clob
	 * @return
	 * @throws SQLException
	 * @throws IOException
	 */
	public static String ClobToString(Clob clob) throws SQLException, IOException{
		String str="";
		Reader reader=clob.getCharacterStream();//得到流
		BufferedReader bReader=new BufferedReader(reader);
		String s = bReader.readLine();
		StringBuffer strBuffer = new StringBuffer();
		while(s!=null){//执行循环将字符串全部取出附值给StringBuffer由StringBuffer转成String
			strBuffer.append(s);
			s=bReader.readLine();
		}
		str=strBuffer.toString();
		return str;
	}

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Fresco源码解析 - Hierarachy-Vie.. 下一篇多重虚继承下的对象内存布局

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: