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
| public List chercheravance(String critere) throws java.lang.ClassNotFoundException,SQLException,DonneesIncompletesException{
int i=0;
List v = new Vector();
try {
//ResultSet r=s.executeQuery("Select * from materiel where " + critere );
Query="Select * from materiel where "+critere;
System.out.println("requete:"+Query);
r=s.executeQuery(Query);
// getS().executeUpdate(Query);
while (r.next()) {
materiel e=new materiel();
e.setModel(r.getString("model"));
e.setTypeM(r.getString("type"));
e.setSerial(r.getString("serial"));
System.out.println("m"+r.getString(model));
v.add(i,e);
i++;
}
} catch (SQLException ex) {
System.out.println("fonction chercher : "+ ex.getMessage());
}
return v;
} |
Partager