Java SQL Clob ConvertClobToString(StringBuffer sb, Clob clob)

Here you can find the source of ConvertClobToString(StringBuffer sb, Clob clob)

Description

Convert Clob To String

License

Open Source License

Declaration

public static String ConvertClobToString(StringBuffer sb, Clob clob) throws SQLException, IOException 

Method Source Code


//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();
    }
}

Related

  1. convert(Object o, Class targetType)
  2. convertClob2String(Clob clob)
  3. convertToString(Object obj)
  4. getClobToString(Clob clob)
  5. getFormattedClobColumn(final InputStream is)
  6. getRSClob(Object obj, String def)