Here you can find the source of getBooleanOrNull(ResultSet rs, String column)
public static Boolean getBooleanOrNull(ResultSet rs, String column) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static Boolean getBooleanOrNull(ResultSet rs, String column) throws SQLException { boolean bVal = rs.getBoolean(column); //hack alert => getBoolean doesn't alway set the wasNull properly http://bugs.mysql.com/bug.php?id=17450 if (!bVal && rs.wasNull()) { return null; }/*from w ww . ja va2 s. c o m*/ return new Boolean(bVal); } }