Monday, 19 August 2013

how to insert clob in DB2 using Reader setCharacterStream

how to insert clob in DB2 using Reader setCharacterStream

Reader nrd = new StringReader(infoBean.getSpecInsAfter());
Reader ord = new StringReader(infoBean.getSpecInsBefore());
psPMPDSA.setCharacterStream(1, ord, infoBean.getSpecInsBefore().length());
psPMPDSA.setCharacterStream(2, nrd, infoBean.getSpecInsAfter().length());
psPMPDSA.executeUpdate();
when I use this, this works perfect fine on my development DB2 db, but
doesn't work on my client db. error received: The value of input host
variable or parameter number "1" cannot be used because of its data type..
SQLCODE=-301, SQLSTATE=07006, DRIVER=3.53.95
Can anyone suggest why the difference, I did some research on net and
found this, http://www-01.ibm.com/support/docview.wss?uid=swg21216635
we do not wish to make any change in WAS server DS setting. so could this
be handled in code... ??

No comments:

Post a Comment