1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| catch (SQLException se)
{
JOptionPane.showMessageDialog(this,sql+"\n"+se.getMessage(),"Chargement de la table impossible !",JOptionPane.ERROR_MESSAGE);
}
try
{
Statement requete1 = ConnectionBD.createStatement();
sql="select DISTINCT * from options,etudiant WHERE etudiant.code_option=options.code_option ORDER BY options.code_option";
ResultSet resultat = requete1.executeQuery(sql);
while (resultat.next())
{
tEtud.ajoute(resultat.getString(1)+resultat.getString(2));
}
}
catch (SQLException se)
{
JOptionPane.showMessageDialog(this,sql+"\n"+se.getMessage(),"Chargement de la table impossible !",JOptionPane.ERROR_MESSAGE);
} |
Partager