Bonjour, j'ai besoin de votre aide pour savoir pour quoi ce bout de code ne me donne pas le résultat attendu :
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
  String sel = null;
                sel = (String) AfficherRDP.jList1.getSelectedValue();
                String Nom = sel;
                String req = "SELECT * FROM `post` where Nom='" + Nom + "'";
                Statement stmt;
 
                DBConnector cnx = new DBConnector();
 
                stmt = (Statement) cnx.conn.createStatement();
                System.out.println("Nom:" + Nom);
                ResultSet r = stmt.executeQuery(req);
 
               while (r.next()) {
 
                    String val = r.getString("val");
                    int pl = r.getInt("place");
                    int tr = r.getInt("transition");
                    System.out.println("P:  " + pl + "T:  " + tr + "val:" + val);
 
                    int k;
                    String var;
                    Matrice_ PRE = new Matrice_(pl, tr, "PRE BD");
                    PRE.initialisation();
 
                    Matrice_ POST = new Matrice_(tr, pl, "POST BD");
                    POST.initialisation();
 
                    StringTokenizer str = new StringTokenizer(val, "/");
                    //   for (int i = 0; i < pl && str.hasMoreElements(); i++) {
                    for (int j = 0; j < tr && str.hasMoreElements(); j++) {
                        for (int l = 0; l < tr && str.hasMoreElements(); l++) {
 
                            var = (String) str.nextElement();
                            k = Integer.parseInt(var);
 
                            PRE.inserer(j, l, k);
                            PRE.initialisation();
                            PRE.Afficher();
                        }
                    }
                }
 
            }
 
        });
d'après le résultat tout ce qui après la boucle while ne s’exécute pas et je ne comprend pas pk et je n'est pas de message d'erreur