Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. public ArrayList afficherListMaster(int mat) {
  2. // TODO Auto-generated method stub
  3. ArrayList list= new ArrayList<>();
  4. String msg= "SELECT * FROM postuler , specality WHERE postuler.matricule = "+mat+" and specality.id_spec = postuler.id_spec";
  5.  
  6. Connection cnx =Mycnx.connect();
  7. try {
  8. Statement stat = cnx.createStatement();
  9. ResultSet res =stat.executeQuery(msg);
  10.  
  11. while(res.next())
  12. {
  13.  
  14. list.add(res.getString("specialiter"));
  15. }
  16. res.close();
  17. stat.close();
  18. cnx.close();
  19.  
  20. } catch (SQLException e) {
  21. // TODO Auto-generated catch block
  22. e.printStackTrace();
  23. }finally
  24. {
  25.  
  26. return list;
  27. }
  28.  
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement