Inspires toi de ce qui suit en utilisant PreparedStatement.
public void getConnection() {
try {
conn = DriverManager.getConnection("jdbc:odbc:Contactmdb"); // Contactmdb est different pour toi
} catch (SQLException se) { }
}
PreparedStatement pstmt = conn.prepareStatement("UPDATE AdressBook " +
"SET Title= ?," +
"Name= ? , " +
"TypePhone= ? , " +
"Addr1= ? , " +
"Addr2= ? , " +
"City= ? , " +
"State= ? , " +
"Zip= ? , " +
"Phone = ? " +
" WHERE Name=? and TypePhone=?");
pstmt.setString(1, c.getTitle());
pstmt.setString(2, c.getName());
pstmt.setString(3, c.getTypeph());
pstmt.setString(4, c.getAddr1());
pstmt.setString(5, c.getAddr2());
pstmt.setString(6, c.getCity());
pstmt.setString(7, c.getState());
pstmt.setString(8, c.getZip());
pstmt.setString(9, c.getPhone());
pstmt.setString(10, c.getName());
pstmt.setString(11, c.getTypeph());
pstmt.executeUpdate();
salut Tahar