protected String clobToString(Clob clobData) throws SQLException, IOException {

        String returnData = "";

        if (clobData != null) {
            try {
                returnData = IOUtils.toString(clobData.getCharacterStream());
            } finally {
                // The most important thing here is free the CLOB to avoid memory Leaks
                clobData.free();
            }
        }
        return returnData;
    }
From java.sql.CLOB to String

@return string representation of clob
@throws SQLException IOException
src/main/java/org/replicadb/manager/SqlManager.java