Multiple Events in Calendar

guys, need help on how to add multiple events in calendar, I’ve been trying to query the events from my DB as simple as possible but the output only post the last query from the DB multiple times, depending on how many rows have been queried.


Connection conn = getConnection.connection();
        try {
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery("SELECT * FROM calendar_events");
            while(rs.next()){
                Date eventStartDate = conUtil.parsingDate(rs.getString("startDate"));
                cal.setTime(eventStartDate);
                Date startEvent = cal.getTime();
                Date eventEndDate = conUtil.parsingDate(rs.getString("endDate"));
                cal.setTime(eventEndDate);
                Date endEvent = cal.getTime();
                
                event.setStyleName(rs.getString("color"));
                event.setCaption(rs.getString("caption"));
                event.setDescription(rs.getString("description"));
                event.setStart(startEvent);
                event.setEnd(endEvent);
                events.add(event);
            }
        } catch (SQLException ex) {
            Logger.getLogger(MyEventProvider.class.getName()).log(Level.SEVERE, null, ex);
        }finally{
            try {
                if(conn != null || !conn.isClosed()){
                    conn.close();
                }
            } catch (SQLException ex) {
                Logger.getLogger(MyEventProvider.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

return events;