views:

55

answers:

1

I am using JSP to access Oracle 10g. One of the table includes a field with clob data type.

When it is retrieved with getString API and be assigned to String type, it gives an error (java.sql.SQLException: Conversion to String failed)

I found that it only happens if the Statement is prepared with parameter ResultSet.CONCUR_UPDATABLE (not FORWARE ONLY)

Is there any workaround as I need to use those API of ResultSet to play around the ResultSet later.

Thanks.

A: 

It seems that I found the way. In order to use ResultSet.CONCUR_UPDATABLE for ResultSet, the clob field cannot be get with getString. It needs to be retrieved by using getClob.

That's what I did:

clobObj = rsJobList.getClob(6); strTemp[4] = clobObj.getSubString(1, (int)clobObj.length());

Then the the string can be obtained

Anyone can comment whether My method is ok ?

Thanks.

SkyEagle888