Java SQL ResultSet Boolean Read getBoolean(ResultSet rs, String name)

Here you can find the source of getBoolean(ResultSet rs, String name)

Description

get Boolean

License

Open Source License

Declaration

public static Object getBoolean(ResultSet rs, String name) 

Method Source Code


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

import java.sql.ResultSet;
import java.sql.SQLException;

public class Main {
    public static Object getBoolean(ResultSet rs, String name) {
        try {/*from   w w w.j av a2 s .c  o  m*/
            return "\"" + name + "\":" + rs.getBoolean(name) + "";
        } catch (SQLException ex) {
            return "\"" + name + "\":\"error\"";
        }
    }
}

Related

  1. getBoolean(ResultSet resultSet, int columnIndex)
  2. getBoolean(ResultSet rs, int index)
  3. getBoolean(ResultSet rs, String colName)
  4. getBoolean(ResultSet rs, String columnLabel)
  5. getBoolean(ResultSet rs, String columnName)
  6. getBooleanFromResultSet(ResultSet rset, String field)
  7. getBooleanOrNull(ResultSet rs, String column)
  8. getBooleanSuppressSQLException(final ResultSet rs, final String columnLabel)
  9. getBooleanValue(ResultSet resultSet, int columnIndex)