我正在删除和更新 SQLite 数据库,但删除和更新后数据库记录中没有发生更改
更新功能:
public void update(int iD, String name, String gender, String date,String branch, String mob, String email, String address) {
// TODO Auto-generated method stub
String [] para = new String[7];
para[0]= name; para[1]=gender; para[2]=date; para[3]=branch; para[4]=mob; para[5]=email; para[6]=address;
db.execSQL("UPDATE stud SET Name=?,Gender=?,DOB=?,Branch=?,Mobile=?,EmailId=?,Address=? WHERE _id="+iD+"",para);
System.out.println("data updated....");
}
删除功能:
public void deleteData(int id) {
// TODO Auto-generated method stub
System.out.println("in del");
db.execSQL("DELETE FROM stud WHERE _id='"+id+"'");
System.out.println("data deleted...");
}
查询后的语句被执行。db 是 SQLite 数据库变量。