Here you can find the source of getStringFromClob(Clob clob)
public static String getStringFromClob(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 getStringFromClob(Clob clob) throws SQLException, IOException { String returnValue = null; Reader reader = null;//from w w w . j av a 2s . c o m try { // Convert CLOB description to String. if (clob != null && clob.length() != 0) { reader = clob.getCharacterStream(); int clobSize = (int) clob.length(); char[] buffer = new char[clobSize]; reader.read(buffer); returnValue = new String(buffer); reader.close(); } else { } } finally { if (reader != null) { reader.close(); } } return returnValue; } }