Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
715 views
in Technique[技术] by (71.8m points)

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...