Java Utililty Methods SQL ResultSet Boolean Read

List of utility methods to do SQL ResultSet Boolean Read

  1. HOME
  2. Java
  3. S
  4. SQL ResultSet Boolean Read

Description

The list of methods to do SQL ResultSet Boolean Read are organized into topic(s).

Method

Boolean getBoolean(ResultSet res, String name)
Returns the values of the specified column as a Boolean.
boolean v = res.getBoolean(name);
return res.wasNull() ? null : v;
Boolean getBoolean(ResultSet resultSet, int columnIndex)
get Boolean
boolean value = resultSet.getBoolean(columnIndex);
return resultSet.wasNull() ? null : value;
boolean getBoolean(ResultSet rs, int index)
get Boolean
if (rs.getObject(index) != null) {
 return rs.getBoolean(index);
throw new RuntimeException("Null value in non-Nullable column");
Boolean getBoolean(ResultSet rs, String colName)
get Boolean
boolean res = rs.getBoolean(colName);
return rs.wasNull() ? null : new Boolean(res);
Boolean getBoolean(ResultSet rs, String columnLabel)
get Boolean
String booleanString = getTrimmedString(rs, columnLabel);
if ("1".equals(booleanString)) {
 return Boolean.TRUE;
} else if ("0".equals(booleanString)) {
 return Boolean.FALSE;
} else {
 return null;
Boolean getBoolean(ResultSet rs, String columnName)
get a Boolean object from a result set column with given name
boolean value = rs.getBoolean(columnName);
if (rs.wasNull()) {
 return null;
return value;
Object getBoolean(ResultSet rs, String name)
get Boolean
try {
 return "\"" + name + "\":" + rs.getBoolean(name) + "";
} catch (SQLException ex) {
 return "\"" + name + "\":\"error\"";
boolean getBooleanFromResultSet(ResultSet rset, String field)
get Boolean From Result Set
return rset.getBoolean(field);
Boolean getBooleanOrNull(ResultSet rs, String column)
get Boolean Or Null
boolean bVal = rs.getBoolean(column);
if (!bVal && rs.wasNull()) {
 return null;
return new Boolean(bVal);
boolean getBooleanSuppressSQLException(final ResultSet rs, final String columnLabel)
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
boolean columnValue = false;
try {
 columnValue = rs.getBoolean(columnLabel);
} catch (SQLException ex) {
return columnValue;


AltStyle によって変換されたページ (->オリジナル) /