コード例 #1
0
 public void updateActive(Customer customer) {
   db.beginTransaction();
   try {
     db.execSQL(
         "UPDATE customer set active = ? where phonenumber = ?;",
         new Object[] {customer.getActive(), customer.getPhonenumber()});
     db.setTransactionSuccessful();
   } finally {
     db.endTransaction();
   }
 }
コード例 #2
0
 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();
   }
 }