我正在使用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());
系统抛出异常
[jcc] [10120] [11936] [4.3.111]无效操作:Lob关闭。 ERRORCODE = -4470,SQLSTATE = null
我做错了什么?
如何解决此问题?
答案 0 :(得分:11)
可以通过向连接URL
添加progressiveStreaming=2;
参数来解决此问题
完整指定的连接URL如下所示:
jdbc:db2://localhost:50000/SAMPLE:progressiveStreaming=2;
如果您对该参数有异常,请在其中添加以下内容:
jdbc:db2://localhost:50000/SAMPLE:driverType=4;fullyMaterializeLobData=true;fullyMaterializeInputStreams=true;progressiveStreaming=2;progresssiveLocators=2;
最好使用db2jcc4.jar
答案 1 :(得分:0)
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
对我有用。