// Convert clob to string
If (OB [3] instanceof org. hibernate. lob. serializableclob) {// clob Processing
Clob = (clob) ob [3]; // obtain the value of clob
String clobstring = clob. getsubstring (1, (INT) clob. Length (); // converts a value of the clob type to a value of the string type.
S. setsubcontent (clobstring = NULL? "": Clobstring );
}
// Convert clob to string
Public static string getclobtostring (Java. SQL. clob ){
String strval = "";
Try {
If (clob = NULL)
Return "";
Bufferedreader in = new bufferedreader (clob. getcharacterstream ());
Char [] BB = new char [(INT) clob. Length ()];
Int I = 0;
Int itotal = 0;
For (; itotal <clob. Length (); itotal = I + itotal ){
I = in. Read (BB, itotal, (INT) (clob. Length ()-itotal ));
}
Strval = "";
For (Int J = 0; j <BB. length; j ++ ){
Character c = new character (BB [J]);
Strval = strval + C. tostring ();
}
} Catch (exception e ){
E. printstacktrace ();
}
Return strval. Trim ();
}