I am trying to save XML response which comes as StrignBuffer to method.
I need to save this string data to Sql as CLOB and retrieve the same.
The response can be upto 3-4Kb, which should be retrieved to StringBuffer again
Can any one give me tutorial or sample code which doesn’t include db specific methods/jars.
I can change db column type if CLOB is not suitable or any other better alternative.
Please suggest.
You can create a
CLOBby callingconnection.createClob(), then you can populate it with methods such assetString,setCharacterStreamorsetAsciiStream.Create a
PreparedStatementand call itssetClob()to store your CLOB in the databae.Retrieving the data is just the same, read it from a
ResultSetand callgetCharacterStream,getAsciiStreamorgetSubStreamon it.