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
|
Vector titre=new Vector();
titre.add("Référence");
titre.add("Nom");
titre.add("Activé");
Vector data=new Vector();
int i=0;
try{
Statement stmt=connection.getConnection().createStatement();
ResultSet res=stmt.executeQuery("select * from produits_descriptions pd,produits p where pd.products_id=p.products_id");
while (res.next())
{
Vector donne=new Vector();
donne.add(res.getString("ref_produit"));
donne.add(res.getString("products_name"));
donne.add(new Boolean(true));
data.add(donne);
}
}catch(SQLException sqle)
{
System.out.println(sqle);
}
table=new JTable(data,titre);
panneau=new JScrollPane (table);
add(panneau); |
Partager