public static String parse(Blob blob) {
String content = "";
try {
InputStream reader = blob.getBinaryStream();
byte[] buffer = new byte[1000];
int nbytes = 0;
while ((nbytes = reader.read(buffer)) != -1)
content += new String(buffer, 0, nbytes);
reader.close();
} catch (Exception e) {
}
return content;
}
public static String parse(Clob clob) {
String content = "";
try {
Reader reader = clob.getCharacterStream();
char[] buffer = new char[1000];
int nbytes = 0;
while ((nbytes = reader.read(buffer)) != -1)
content += new String(buffer, 0, nbytes);
reader.close();
} catch (Exception e) {
}
return content);
}
String content = "";
try {
InputStream reader = blob.getBinaryStream();
byte[] buffer = new byte[1000];
int nbytes = 0;
while ((nbytes = reader.read(buffer)) != -1)
content += new String(buffer, 0, nbytes);
reader.close();
} catch (Exception e) {
}
return content;
}
public static String parse(Clob clob) {
String content = "";
try {
Reader reader = clob.getCharacterStream();
char[] buffer = new char[1000];
int nbytes = 0;
while ((nbytes = reader.read(buffer)) != -1)
content += new String(buffer, 0, nbytes);
reader.close();
} catch (Exception e) {
}
return content);
}
解决方案 »
- Struts2 重复提交问题
- Hibernate问题
- response.addCookie怎么添加之后。在ie的缓存文件夹中找不到
- jsp实现在线阅读pdf文件
- 对java的正则对象不太熟悉,求一个用正则获取子匹配的hello world 程序
- 咋解决的?求求大神们,指点一下
- servlet向html输出验证错误消息 有解决办法 ?
- 我们为何而用hibernate?
- tomcat 连接不上Oracle9i,急,在线等.先谢谢了
- 打算用jboss+mysql+jbuilder来开发j2ee项目,请各位给点意见,特别是建模和性能方面的,来者有分!!!!!!
- 如何用servlet在sql server数据库的插入后执行相应动作?
- 各位大师,走过,路过,千万不要“吝啬”啊~~帮帮忙啊 50分~
InputStream reader = blob.getBinaryStream();
byte[] buffer = new byte[1000];
int nbytes = 0;
while ((nbytes = reader.read(buffer)) != -1)
out.println(buffer);