Code example for ResultSet

Methods: getBoolean, getInt, getString

0
    public static final RolesRowMapper instance = new RolesRowMapper();
 
    @Override 
    public roles mapRow(ResultSet rs, int rowNum) throws SQLException {
        roles entity = new roles();
        entity.setdescription(rs.getString("description"));
        entity.setId(Guid.createGuidFromString(rs.getString("id")));
        entity.setname(rs.getString("name"));
        entity.setis_readonly(rs.getBoolean("is_readonly"));
        entity.setType(RoleType.getById(rs.getInt("role_type")));
        entity.setAllowsViewingChildren(rs.getBoolean("allows_viewing_children"));
        return entity;
    } 
 
}