现有用户信息表userinfo,表结构如下:id integer 主键,自增长;uname text 用户名;password text 密码。如果想更新用户名为的密码为321,下面方法正确的是()
A.
private void update(SQLiteDatabase db){ ... String sql="update from userinfo set password = '321' where uname='四'"; db.execSQL(sql); ... }
B.
private void update(SQLiteDatabase db){ ... String sql="update userinfo set password = '321' where id='四'"; db.execSQL(sql); ... }
C.
private void delete(SQLiteDatabase db){ ... ContentValues cv = new ContentValues(); cv.put("password","321"); db.update("userinfo",cv,"uname = ?",new String[]{"张三"}) ... }
D.
private void update(SQLiteDatabase db){ ... String sql="update userinfo password = '321' where uname='四'"; db.execSQL(sql); ... }