JiveJdon Community Forums
在线126人 J道首页 | 论坛首页 | 培训咨询 | 开源框架 | 精华 | 查搜 | 注册 | 登陆 |
首页 » 论坛 » J2EE/JavaEE/JEE/EJB/JSF等技术讨论
???en_US.forumThreadPrev.name??? 上一主题
Go back to the topic listing   返回主题列表
???en_US.forumThreadNext.name??? 下一主题
这个主题共有 1 回复 / 1 页 [ ]  发表新帖子  回复该主题贴
飞翔羽毛

发表文章: 1
注册时间: 2004年04月01日 20:20
linux下,oracle816读写大字段问题(clob) 发表: 2004年04月01日 20:39 回复
错误: java.lang.Exception: Io exception: Broken pipe


下面是我写的代码的一部分,请注意Writer开始的那一段,错误出现在writer.flush() ;上,就是写入数据的时候出错。
环境1:在window上安装的oracle816数据库+Tomacat4.0+window2000server中文版上运行无误~!!
环境2:在linux上安装的oracle816数据库,字符集GBK+Tomacat4.0+linux +jdk1.4.1_03-b02,运行时报错,错误就是上面写的那个
try{
sts = con.prepareStatement("insert into infor_content values(?,Empty_clob())");
sts.setLong(1,newitem.getInfor_id());
sts.executeUpdate();

stmts = con.prepareStatement("select * from infor_content where infor_id=? for update ");
stmts.setLong(1,newitem.getInfor_id());
rs = stmts.executeQuery();

if(rs.next()){
oracle.sql.CLOB clob = (oracle.sql.CLOB)rs.getClob(2);
Writer writer = clob.getCharacterOutputStream();
writer.write(newitem.getContentHtml());
writer.flush() ;
writer.close();
}
}catch(Exception e){
throw new Exception("插入信息内容失败!" + e.getMessage() );
}finally{
com.wits.util.database.dbtool.doCloseDB(rs,stmts,null);
com.wits.util.database.dbtool.doCloseDB(null,sts,null);
}

目前为止试了clob很多其他的方法,全是到writer.flush() ;那里出错,有Exception 中文信息,不能从套接字中取得信息。
拜托诸位大侠了,小弟我急的胡子都白了......还要看人家的白眼......拜托了......

simpletao

发表文章: 1
注册时间: 2005年01月23日 18:33
Re: linux下,oracle816读写大字段问题(clob) 发表: 2005年01月23日 18:35 回复
con.setAutoCommit(false)
这个主题有 1 回复 / 1 页 [ ]
???en_US.forumThreadPrev.name??? 上一主题
Go back to the topic listing   返回主题列表    返回页首  返回页首
???en_US.forumThreadNext.name??? 下一主题
热点TAG: AOP cache DDD EJB 集群 设计模式 Hibernate IOC JiveJdon OO RBAC Spring Struts
查询本论坛内 回复超过的热门帖子
快速发表回复
标题
 
粗体 斜体 下划线 插入图片 插入代码 插入url链接 插入附件
内容
 

解惑之道在J道 ,打造中国最具影响力的的企业软件社区
OpenSource JIVEJDON v3.0 Powered by JdonFramework Code © 2002-07 jdon.com

anti spam