Java SQL Clob getString(Clob c)

Here you can find the source of getString(Clob c)

Description

get String

License

Apache License

Declaration

public static String getString(Clob c) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.BufferedReader;
import java.io.IOException;
import java.sql.Clob;
import java.sql.SQLException;

public class Main {

    public static String getString(Clob c) {
        StringBuffer s = new StringBuffer();
        if (c != null) {
            try {
                BufferedReader bufferRead = new BufferedReader(
                        c.getCharacterStream());
                try {
                    String str;//from w  w  w.j  a v a2s .  c  o  m
                    while ((str = bufferRead.readLine()) != null) {
                        s.append(str);
                    }
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        return s.toString();
    }
}

Related

  1. ConvertClobToString(StringBuffer sb, Clob clob)
  2. convertToString(Object obj)
  3. getClobToString(Clob clob)
  4. getFormattedClobColumn(final InputStream is)
  5. getRSClob(Object obj, String def)
  6. getStringFromClob(Clob clob)
  7. isNClob(final Class type)
  8. parseToString(Clob clob)
  9. read(Clob c)