Bonjour,

je souhaite mettre a jour une ligne d'une table "client" d'une base de données , mon code est:
Code :
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
try
{
Statement st=ex.createStatement();
StringBuffer ac = new StringBuffer("update client set nom ='");
ac.append(t1.getText()) ;
ac.append(" ',prenom='") ;			
ac.append(t2.getText()) ;
ac.append(" 'where nom='");
ac.append(t1.getText()) ;
ac.append( "' " ) ;
st.executeUpdate(ac.toString());						
st.close();
ex.close();		
}catch(Exception e){
System.out.println(e.getMessage());}