2012年11月23日
来源:互联网 发布:td 数据超出省略号 编辑:程序博客网 时间:2024/05/11 02:28
package net.hys.reg.util;
import java.io.Reader;
import java.sql.Clob;
public class DBUtil {
public finalstatic String clob2String(Clob clob)
{
if (clob == null)
{
return null;
}
StringBuffer sb = new StringBuffer(65535);//64K
Reader clobStream = null;//创建一个输入流对象
try
{
clobStream = clob.getCharacterStream();
char[] b = new char[60000];//每次获取60K
int i = 0;
while((i = clobStream.read(b)) != -1)
{
sb.append(b,0,i);
}
}
catch(Exception ex)
{
sb = null;
}
finally
{
try
{
if (clobStream != null)
clobStream.close();
}
catch (Exception e)
{
}
}
if (sb == null)
return null;
else
return sb.toString();
}
}
//row是一个对象(JAVABEAN)类
有个private String topic 属性;
rs 是一个ResultSet
row.setTopic(DBUtil.clob2String((Clob)rs.getClob("topic")));
import java.io.Reader;
import java.sql.Clob;
public class DBUtil {
}
//row是一个对象(JAVABEAN)类
有个private String topic 属性;
rs 是一个ResultSet
0 0
- 2012年11月23日 星期五
- 2012年11月23日
- 11月23日
- 11月23日
- 11月23日
- 11月23日
- 2012年7月23日11:33:12
- 2012年4月23日
- 写在2012年7月23日
- 2012年07月23日
- 2012年08月23日
- 2012年10月23日
- 2012年10月23日
- 2012年10月23日
- 2012年10月23日
- 2007年11月23日
- 2013年11月23日
- 2014年11月23日
- xheditor-文件上传-java-支…
- Firefox中console的用法
- Struts2.1XX 后台不打印异常问题
- x86 和 x64的区别
- JBOSS 局域网不能访问,本机也…
- 2012年11月23日
- 网页编码就是那点事【转载】
- 父窗口和iframe子窗口之间相互传递…
- jquery选择器 参数为变量 如何解决
- 生成xml字符串并下载(前台通过按…
- 将string转换成inputstream
- easyui 正则表达式验证扩展(…
- JSP禁用缓存常用方法
- jQuery 事件动态绑定初…