Here you can find the source of getBoolean(ResultSet rs, String columnLabel)
public static Boolean getBoolean(ResultSet rs, String columnLabel) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static Boolean getBoolean(ResultSet rs, String columnLabel) throws SQLException { String booleanString = getTrimmedString(rs, columnLabel); if ("1".equals(booleanString)) { return Boolean.TRUE; } else if ("0".equals(booleanString)) { return Boolean.FALSE; } else {//from w w w.j a v a2 s.c om return null; } } public static String getTrimmedString(ResultSet rs, String columnLabel) throws SQLException { return nullIfEmpty(getString(rs, columnLabel)); } public static String nullIfEmpty(String text) { return cleanLongText(text); } public static String getString(ResultSet rs, String columnLabel) throws SQLException { return rs.getString(columnLabel); } public static String cleanLongText(String text) { if (text != null) { String trimmedText = text.trim(); if (trimmedText.length() > 0) { return trimmedText; } } return null; } }