I have problem in taking from the database the startdate and the finaldate of task to draw the chart
public IntervalCategoryDataset getCategoryDataset() {
    conn = ConnectDB.ConnectDB();
    TaskSeriesCollection dataset = new TaskSeriesCollection();
    String sql = "SELECT `TITRE`, `DATE DEBUT Prévi`, `DATE FIN prévi` FROM `projet`;";
    try {
        pst = conn.prepareStatement(sql);
        rs = pst.executeQuery(sql);
        while (rs.next()) {
            String a = rs.getString("TITRE");
            Date StartDate = rs.getDate("DATE DEBUT Prévi");
            Date EndDate = rs.getDate("DATE FIN prévi");
            Names.add(a);
            Dates.add(StartDate);
            Dates.add(EndDate);
            ++count;
        }
    } catch (Exception e) {
        JOptionPane.showMessageDialog(null, e.getMessage());
    }
    int j = 0;
    int k = 1;
    TaskSeries series1 = new TaskSeries("Estimated Date");
    for (int i = 0; i < count; i++) {
        series1.add(new Task(Names.get(i),
                Date.from(LocalDate.of(Dates.get(j).getYear(), Dates.get(j).getMonth(), Dates.get(j).getDay())
                        .atStartOfDay()
                        .toInstant(ZoneOffset.UTC)),
                Date.from(LocalDate.of(Dates.get(k).getYear(), Dates.get(k).getMonth(), Dates.get(k).getDay())
                        .atStartOfDay()
                        .toInstant(ZoneOffset.UTC))));
    }
    dataset.add(series1);
    return dataset;
}
I expect to have for every tasks its chart but I have the same chart for all the tasks.