Example #1
0
 public void produit() {
   String sql = "SELECT * FROM produit";
   try (Statement stmt = conn.createStatement();
       ResultSet rs = stmt.executeQuery(sql); ) {
     // System.out.println("uniter Table:");
     while (rs.next()) {
       Produit produit = new Produit();
       produit.setIdcat(rs.getInt("cat"));
       produit.setIdproduit(rs.getInt("idproduit"));
       produit.setNomProduit(rs.getString("ref"));
       produit.setQnt(rs.getInt("qnt_unt"));
       ProduitList.add(produit);
     }
   } catch (SQLException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
 }