Tuesday, March 29, 2011

How to get CLOB data extending Spring Stored Procedure interface

declareParameter(new SqlOutParameter(OUT_PARAMETER, Types.CLOB ,null,new SqlReturnType()
{
public Object getTypeValue(CallableStatement cs, int i, int sqlType, String typeName)
throws SQLException
{
try
{
final Clob aClob = cs.getClob(i);
final Reader clobReader = aClob.getCharacterStream();
int length = (int) aClob.length();
char[] inputBuffer = new char[1024];
final StringBuffer outputBuffer = new StringBuffer();
while ((length = clobReader.read(inputBuffer)) != -1)
{
outputBuffer.append(inputBuffer, 0, length);
}
return outputBuffer.toString();
} catch (IOException e)
{
_log.info("Exception in processing the Clob data for retriving ");
throw new SQLException(e.toString());
}

}

}
));

2 comments:

  1. how to make money by betting and make money online? - Work
    How to make money by betting and make money online? - This online betting guide 1xbet korean explains how to make money by 바카라 사이트 betting and หาเงินออนไลน์ makes money

    ReplyDelete