Here you can find the source of ConvertClobToString(StringBuffer sb, Clob clob)
public static String ConvertClobToString(StringBuffer sb, Clob clob) throws SQLException, IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.Reader; import java.sql.Clob; import java.sql.SQLException; public class Main { public static String ConvertClobToString(StringBuffer sb, Clob clob) throws SQLException, IOException { Reader reader = clob.getCharacterStream(); char[] buffer = new char[(int) clob.length()]; while (reader.read(buffer) != -1) { sb.append(buffer);/*from w w w .j av a 2 s. c om*/ } return sb.toString(); } }