|
这个主题共有 1 回复 / 1 页 [
]
|
|
|
|
|
|
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 中文信息,不能从套接字中取得信息。 拜托诸位大侠了,小弟我急的胡子都白了......还要看人家的白眼......拜托了......
|
|
|
|
|
|
Re: linux下,oracle816读写大字段问题(clob)
|
发表: 2005年01月23日 18:35
|
回复
|
|
|
|
|
|