public synchronized void save(SQLiteDatabase database) { ContentValues values = Gen_getValues(); values.remove(GEN_FIELD__ID); // Never save the SSH password and passphrase. values.put(GEN_FIELD_SSHPASSWORD, ""); values.put(GEN_FIELD_SSHPASSPHRASE, ""); if (!getKeepPassword()) { values.put(GEN_FIELD_PASSWORD, ""); } if (isNew()) { set_Id(database.insert(GEN_TABLE_NAME, null, values)); } else { database.update( GEN_TABLE_NAME, values, GEN_FIELD__ID + " = ?", new String[] {Long.toString(get_Id())}); } }
/** Executes an UPDATE query. */ public int update(SQLiteDatabase db, ContentValues values) { return db.update(mTable, values, mCondition, mArgs); }