Lob关闭了。 ERRORCODE = -4470,SQLSTATE = null
我正在使用IBM websphere commerce和db2,有以下代码段
Clob clobVar = null; if (result.elementAt(3) != null) clobVar = (Clob) result.elementAt(3); if (clobVar == null) { infoTable.put("EInfo", ""); } else { stringTemp = clobVar.getSubString(1, (int) clobVar.length()); infoTable.put("EInfo", stringTemp); }
代码工作正常,直到
clobVar = (Clob) result.elementAt(3);
但是一旦执行就到了
stringTemp = clobVar.getSubString(1, (int) clobVar.length());
系统抛出exception
[jcc] [10120] [11936] [4.3.111]无效操作:Lob关闭。 ERRORCODE = -4470,SQLSTATE = null
我做错了什么?
如何解决这个问题?
这个问题可以通过添加progressiveStreaming=2;
来解决progressiveStreaming=2;
连接url的参数
完整指定的连接URL如下所示:
jdbc:db2://localhost:50000/SAMPLE:progressiveStreaming=2;
如果您在该参数上有exception,请添加以下内容:
jdbc:db2://localhost:50000/SAMPLE:driverType=4;fullyMaterializeLobData=true;fullyMaterializeInputStreams=true;progressiveStreaming=2;progresssiveLocators=2;
最好使用db2jcc4.jar
If everything has worked earlier with same code...but the issue came up after db2 db change, then try below configuration.. db2set DB2_RESTRICT_DDF=TRUE
它对我有用..