Java SQL ResultSet Boolean Read getBooleanSuppressSQLException(final ResultSet rs, final String columnLabel)

Here you can find the source of getBooleanSuppressSQLException(final ResultSet rs, final String columnLabel)

Description

Retrieves the value of the designated column in the current row of this ResultSet object as a boolean in the Java programming language suppressing SQLException

License

Mozilla Public License

Parameter

Parameter Description
rs a parameter
columnLabel a parameter

Return

boolean value

Declaration

public static boolean getBooleanSuppressSQLException(final ResultSet rs, final String columnLabel) 

Method Source Code

//package com.java2s;
/**//  w  w w . ja  v  a  2  s  .  com
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 */

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

public class Main {
    /**
     * Retrieves the value of the designated column in the current row of this ResultSet object 
     * as a boolean in the Java programming language suppressing SQLException
     * 
     * @param rs
     * @param columnLabel
     * @return boolean value
     */
    public static boolean getBooleanSuppressSQLException(final ResultSet rs, final String columnLabel) {
        boolean columnValue = false;

        try {
            columnValue = rs.getBoolean(columnLabel);

        } catch (SQLException ex) {
        }

        return columnValue;
    }
}

Related

  1. getBoolean(ResultSet rs, String columnLabel)
  2. getBoolean(ResultSet rs, String columnName)
  3. getBoolean(ResultSet rs, String name)
  4. getBooleanFromResultSet(ResultSet rset, String field)
  5. getBooleanOrNull(ResultSet rs, String column)
  6. getBooleanValue(ResultSet resultSet, int columnIndex)