View Javadoc

    1   package sharin.sql.runner.converter;
    2
    3   import java.sql.ResultSet;
    4
    5   import sharin.sql.runner.ColumnConverter;
    6   import sharin.util.SqlUtils;
    7
    8   public class BooleanColumnConverter implements ColumnConverter {
    9
    10      public Object convert(ResultSet rs, int columnIndex) {
    11          boolean value = SqlUtils.getBoolean(rs, columnIndex);
    12
    13          if (value == false && SqlUtils.wasNull(rs)) {
    14              return null;
    15          }
    16
    17          return value;
    18      }
    19  }