Code example for Clob

Methods: getSubString, length

0
  public String getNullableResult(ResultSet rs, String columnName)
      throws SQLException { 
    String value = "";
    Clob clob = rs.getClob(columnName);
    if (clob != null) {
      int size = (int) clob.length();
      value = clob.getSubString(1, size);
    } 
    return value;
  } 
 
  @Override 
  public String getNullableResult(ResultSet rs, int columnIndex)
      throws SQLException { 
    String value = "";
    Clob clob = rs.getClob(columnIndex);
    if (clob != null) {
      int size = (int) clob.length();
      value = clob.getSubString(1, size);
    } 
    return value;