Bonjour, désolé de vous déranger mais j'aurais besoin d'aide lol. Je m'explique, j'ai créé une table nommé films avec plusieurs champs, je voudrais que lorsque l'utilisateur saisisse une date dans un jFrame que j'ai créé, en cliquant sur OK celui-ci lui renvoie un fichier pdf. Mon problème vient de la date, j'arrive à générer un résultat, mais si un film est malheureusement sorti le même jour qu'un autre celui-ci ne s'affiche pas.. Je n'ai qu'un résultat du tableau de ma BDD qui s'affiche alors que plusieurs devraient s'afficher pourtant j'ai bien utilisé un rs.next() pour parcourir la table, je ne comprends pas. Si quelqu'un pouvait m'éclairer juste.. Ce serait très gentil !

Voici un extrait de mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
 
if (jRadioButton2.isSelected()) {
        String date = jTextField1.getText();
        Paragraph paragraph = new Paragraph();
        Document document = new Document(PageSize.A4);
        try {
            PdfWriter.getInstance(document, new FileOutputStream("Test.pdf"));
 
            document.open();
 
            Chunk chunk = new Chunk("Synthèse",
                    FontFactory.getFont(FontFactory.COURIER, 18, Font.NORMAL, Color.WHITE));
            chunk.setBackground(Color.GRAY);
            document.add(chunk);
 
            //Tableau 1
            Table tableau = new Table(3, 2);
            tableau.setBorderColor(Color.white);
            tableau.setPadding(3);
            tableau.setWidth(100);
 
 
 
            try {
                String sql = "SELECT No, Date, Obs, Lieu, Details, id_auteur FROM t_films WHERE Date = '" + date + "'";
                stmt = (PreparedStatement) con.prepareStatement(sql);
                rs = stmt.executeQuery(sql);
 
                rs.next();
                while (rs.next()) {
                    String id = rs.getString(6);
 
                    //JOUR
                    paragraph = new Paragraph(rs.getString(2),
                            new Font(Font.BOLD, 14, Font.BOLD, Color.BLACK));
                    paragraph.setIndentationLeft(210f);
                    document.add(paragraph);
 
                    //Tableau 1
                    Cell cell = new Cell(new Paragraph(rs.getString(3),
                            new Font(Font.BOLD, 12, Font.BOLD, Color.BLACK)));
                    cell.setBorderColor(Color.white);
                    cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                    tableau.addCell(cell);
 
                    cell = new Cell("");
                    cell.setBorderColor(Color.white);
                    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                    tableau.addCell(cell);
 
                    cell = new Cell(new Paragraph("N° : " + rs.getString(1),
                            new Font(Font.BOLD, 12, Font.BOLD, Color.BLACK)));
                    cell.setBorderColor(Color.white);
                    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                    tableau.addCell(cell);
 
                    cell = new Cell(new Paragraph(rs.getString(2),
                            new Font(Font.BOLD, 10, Font.BOLD, Color.BLACK)));
                    cell.setBorderColor(Color.black);
                    cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                    tableau.addCell(cell);
 
                    cell = new Cell(new Paragraph(rs.getString(3),
                            new Font(Font.BOLD, 10, Font.BOLD, Color.BLACK)));
                    cell.setBorderColor(Color.black);
                    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
                    tableau.addCell(cell);
 
                    cell = new Cell(new Paragraph(rs.getString(6),
                            new Font(Font.BOLD, 10, Font.BOLD, Color.BLACK)));
                    cell.setBorderColor(Color.black);
                    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                    tableau.addCell(cell);
 
                    document.add(tableau);
                    document.add(Chunk.NEWLINE);
 
 
                    paragraph = new Paragraph(rs.getString(4),
                            new Font(Font.BOLD, 11, Font.BOLD, Color.BLACK));
                    paragraph.setIndentationRight(20f);
                    document.add(paragraph);
 
                    paragraph = new Paragraph(rs.getString(5),
                            new Font(Font.NORMAL, 11, Font.BOLD, Color.BLACK));
                    paragraph.setIndentationLeft(20f);
                    document.add(paragraph);
                    paragraph = new Paragraph(rs.getString(5),
                            new Font(Font.NORMAL, 11, Font.NORMAL, Color.BLACK));
                    paragraph.setIndentationRight(20f);
                    document.add(paragraph);
 
 
 
 
                        }
                    } catch (Exception e) {
                        System.out.println("Erreur");
                    }
                }     
            } catch (Exception e) {
                System.out.println("Erreur");
            }
 
        document.close();
 
 
        //Execute le PDF
        Runtime runtime = Runtime.getRuntime();
        try {
            runtime.exec(new String[] // 2 parametres pris dans un tableau, l'appli et le pdf
                    {
                        "C:\\Program Files\\Adobe\\Reader 9.0\\Reader\\AcroRd32.exe",
                        "F:\\Projet\\NetBeansProjects\\Films\\Test.pdf"});
        } catch (Exception e) {
            System.out.println("Erreur");
        }
 
    }
Merci encore de votre future aide