Bonsoir les amis, j'a besons de vous pour résoudre un problème. J'ai développé une methode pour inserer dans une table :
Mais j'arrive pas à récuperer le resultat de la premiere rq afin de l'utiliser dans la deuxieme. Il y a quelqu'un qui a une idée??
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 public void insertionSousService(String Nom_Ser, String Nom_Ser_Par, String Ent_Con, String Ent_Abs) throws SQLException { String rq = "select Id_Service from Service where Nom_service = '"+Nom_Ser_Par+"'"; ResultSet res = sta.executeQuery(rq); /*Je veux recuperer la valeur de rq pour l'utiliser dans rq1*/ String rq1 ="INSERT INTO Service (Nom_Service,Entite_Abstraite,Entite_Concrete, Id_Service_Parent) VALUES ('"+Nom_Ser+"', '"+Nom_Ser_Par+"', '"+Ent_Con+"', '"+Ent_Abs+"',"+val+" )"; sta.executeUpdate(rq1); }
Partager