Bonjour, j'ai un petit souci avec la requete SHOW TABLE sous netbeans. Tout mon code marche (conection à la base embarqué h2, ajout de table dans la base) sauf que quand je veux afficher les tables de ma base dans un jComboBox (swing), rien ne s'affiche, ou est le problème?
voici la méthode:
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 private void affichageListeTable(){ try { jComboBox1.removeAllItems(); GestionDatabase gDB= new GestionDatabase(); Connection connection = gDB.getConnection(); List liste = new ArrayList(); liste = qRunner.query(connection,"SHOW TABLES FROM sgmc", new ArrayListHandler()); for (int i=0; i<liste.size(); i++){ Object data[]= (Object[]) liste.get(i); jComboBox1.addItem(data[0]); } gDB.fermerConnexion(); } catch (SQLException ex) { JOptionPane.showMessageDialog(this, ex.getMessage()); } }
Partager