免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 7799 | 回复: 13

用jdbc插入大对象(blob),为何报:Cannot close blob [复制链接]

论坛徽章:
0
发表于 2009-04-23 12:04 |显示全部楼层
5可用积分
各位大侠,请教了!

本人因为工作需要,开发一个可以向informix数据库上传下载文档的程序。开始的时候先用hibenate连的,后来自己配置jdbc,进行连接。都会报这个错:Cannot close blob。

不知道如何解决。

我的数据库中的字段为Variable-length-》byte类型,已经绑定了专门的blob space。

我的程序的主体为:
                                           DataInputStream bis = getBlobInputStream(op, in_filename);
                                File infile = new File(in_filename);
                                int size = (int) infile.length();
                                p.setBinaryStream(1, bis, size);
                                p.executeUpdate();
                                bis.close();
                                p.close();
                                break;

运行到:“p.executeUpdate();”,运行一会儿,即报:Cannot close blob。不知何解。请大侠们指教。

如果需要,本人可以将数据库和程序更多代码贴出,谢谢。

论坛徽章:
0
发表于 2009-04-23 13:42 |显示全部楼层
http://www.javaeye.com/topic/254

参考一下这个。

论坛徽章:
0
发表于 2009-04-23 14:06 |显示全部楼层
那个是oracle的,我的是informix,好像不能通用吧?

论坛徽章:
0
发表于 2009-04-23 14:07 |显示全部楼层

回复 #3 kane999 的帖子

感觉区别不大吧。

论坛徽章:
0
发表于 2009-04-23 14:11 |显示全部楼层
好,我来试试吧

论坛徽章:
0
发表于 2009-04-23 14:16 |显示全部楼层
有更详细的错误信息吗?

论坛徽章:
0
发表于 2009-04-23 16:27 |显示全部楼层
主要的出错信息就这个了,还有一个编码:-603

论坛徽章:
0
发表于 2009-04-23 17:22 |显示全部楼层
用那个oracle的试了一下,还是不行。有很大的问题。

我也不知道咋整啊!

论坛徽章:
0
发表于 2009-04-24 09:45 |显示全部楼层
看看INFORMIX自带的开发文档吧。

论坛徽章:
0
发表于 2009-04-24 10:32 |显示全部楼层
informix 中关于603的描述:
-603        Cannot close TEXT or BYTE value.

This statement writes a BYTE or TEXT value, but some unexpected error
prevented finishing the creation of the value. Roll back the current
transaction. Check the accompanying ISAM error code for more
information. Possibly a hardware error or data corruption of the
storage space or tblspace occurred. If the error recurs, note all
circumstances and contact Technical Support at tsmail@us.ibm.com.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP