Code example for ResultSet

Methods: getInt, getLong, getString

0
    public Accomplishment() { 
    } 
     
    public Accomplishment(ResultSet resultSet) {
        try { 
            this.id = resultSet.getLong("ACCOMPLISHMENT_ID");
            this.sport = resultSet.getString("SPORT");
            this.user_id = resultSet.getLong("USER_ID");
            this.points = resultSet.getInt("POINTS");
            this.lengthInMinutes = resultSet.getInt("LENGTHINMINUTES");
        } catch (SQLException ex) {
            Logger.getLogger(Accomplishment.class.getName()).log(Level.SEVERE, null, ex);
        } 
    } 
 
    public Long getId() {
        return id;
    } 
 
    public void setId(Long id) {
        this.id = id;