Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ArrayList<Annonce> mesannonces(Membre membre){
- Annonce annonce = new Annonce();
- try {
- Class.forName("org.postgresql.Driver");
- java.sql.Connection c=DriverManager.getConnection("jdbc:postgresql://localhost:5432/prjFinal","postgres","azer");
- PreparedStatement p=c.prepareStatement("select*from annonce where id_client=? ;");
- p.setInt(1, membre.getId_membre());
- ResultSet s= p.executeQuery();
- while (s.next()){
- annonce = new Annonce();
- annonce.setId_annonce(s.getInt("id_annonce"));
- annonce.setId_client(s.getInt("id_client"));
- annonce.setId_freelancer(s.getInt("id_freelancer"));
- annonce.setTitre(s.getString("titre"));
- annonce.setType(s.getString("type"));
- annonce.setDelai(s.getInt("delai"));
- annonce.setBudget(s.getInt("budget"));
- annonce.setDate_ajout(s.getDate("date_ajout"));
- annonce.setDesc(s.getString("desc"));
- annonce.setEtat(s.getString("etat"));
- liste.add(annonce);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return liste;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement