voila le code entier de la page modifier ce kil fait
//modify
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 if(action.equals("Modify")) { //code de modification String prj_code; prj_code=(String)jcb_Code.getSelectedItem(); int reponse = JOptionPane.showConfirmDialog(this,"Do you want to modify the noun and hiring:\n"+jt_Name.getText()+"\n"+jt_Location.getText(),"Warning", JOptionPane.YES_NO_OPTION); if(reponse == JOptionPane.YES_OPTION) { this.modif(prj_code,jt_Name.getText(),jt_Location.getText()); } this.dispose(); }
apres il maffiche un message derreur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 private void modif(String Num, String Name, String Location) { MysqlAccess my=new MysqlAccess("mta_info"); String sql; sql="UPDATE db_project SET "; sql+="'dbp_projectname'= " +"'"+Name+"'"+ "','"; sql+="'dbp_projectlocation'="+"'"+Location+"'" ; sql+="where 'dbp_num'="+"'"+Num+"'"; my.startConnection(); my.executeUpdate(sql); my.closeConnection(); }
car jai essaye de faire le test mais ca marche pas
SQL Request : UPDATE db_project SET 'dbp_projectname'= 'nizareazae'',''dbp_projectlocation'='mar'where 'dbp_num'='09031985'
SQLException: Erreur de syntaxe près de ''dbp_projectname'= 'nizareazae'',''dbp_projectlocation'='mar'whe' à la ligne 1
SQLState: 42000
VendorError: 1064
Partager