Java SQL ResultSet Read getAsString(ResultSet res, String field)

Here you can find the source of getAsString(ResultSet res, String field)

Description

get As String

License

Open Source License

Declaration

public static String getAsString(ResultSet res, String field) throws SQLException, IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;
import java.sql.ResultSet;

import java.sql.SQLException;

public class Main {
    public static String getAsString(ResultSet res, String field) throws SQLException, IOException {
        String ret = res.getString(field);
        if (ret == null) {
            return "";
        } else {//from  w w  w . j a v a2s. co m
            return ret;
        }
    }
}

Related

  1. getArray(ResultSet resultSet, String columnLabel, Class clazz)
  2. getArray(ResultSet rs, int index)
  3. getArray(ResultSet rs, String columnName, Class cls)
  4. getArrayAsSet(ResultSet rs, String columnLabel)
  5. getArrayFromResultSet(ResultSet rs, String field)
  6. getBestRowId(String schema, String tableName, int scope, String nullable, ResultSet[] rs)
  7. getBigInteger(ResultSet resultSet, int columnIndex)
  8. getBigIntegerFromResultSet(ResultSet rs, String db_name)
  9. getBigObject(ResultSet set, int columnIndex)