Lob is closed. ERRORCODE=-4470, SQLSTATE=null

拈花ヽ惹草 提交于 2019-12-18 06:08:38

问题


I am using IBM websphere commerce and db2, have following piece of code

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); 
}

Code works fine till

clobVar = (Clob) result.elementAt(3);

but as soon as execution comes to

stringTemp = clobVar.getSubString(1, (int) clobVar.length());

System throws an exception

[jcc][10120][11936][4.3.111] Invalid operation: Lob is closed. ERRORCODE=-4470, SQLSTATE=null

What I am doing wrong?

How to resolve this issue?


回答1:


This issue can be solved by adding progressiveStreaming=2; argument to the connection url

The fully specified Connection URL was to be given as below:

jdbc:db2://localhost:50000/SAMPLE:progressiveStreaming=2;

Incase you have exception on that parameter add the following to it:

jdbc:db2://localhost:50000/SAMPLE:driverType=4;fullyMaterializeLobData=true;fullyMaterializeInputStreams=true;progressiveStreaming=2;progresssiveLocators=2;

It is preferred to use db2jcc4.jar




回答2:


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

It worked for me..



来源:https://stackoverflow.com/questions/22659970/lob-is-closed-errorcode-4470-sqlstate-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!