public void updatePassword(Customer customer) { db.beginTransaction(); try { db.execSQL( "UPDATE customer set password = ? where phonenumber = ?;", new Object[] {customer.getPassword(), customer.getPhonenumber()}); db.setTransactionSuccessful(); } finally { db.endTransaction(); } }
public void add(Customer customer) { db.beginTransaction(); try { db.execSQL( "INSERT INTO customer(_id,phonenumber,password,active,certify) VALUES(?,?,?,?,?)", new Object[] { customer.getId(), customer.getPhonenumber(), customer.getPassword(), customer.getActive(), customer.getCertify() }); db.setTransactionSuccessful(); } finally { db.endTransaction(); } }