Android SQLite3 基础入门
2010-03-25 16:47:00 来源:WEB开发网核心提示:String sql="";try{sql="insert into t_user values(null,'"+uname+"')";db.execSQL(sql);Log.v(TAG,"insert Table t_user ok
String sql="";
try{
sql="insert into t_user values(null,'"+uname+"')";
db.execSQL(sql);
Log.v(TAG,"insert Table t_user ok");
return true;
}catch(Exception e){
Log.v(TAG,"insert Table t_user err ,sql: "+sql);
return false;
}
}
public Cursor loadAll(){
Cursor cur=db.query("t_user", new String[]{"_ID","NAME"}, null,null, null, null, null);
return cur;
}
public void close(){
db.close();
}
}
更多精彩
赞助商链接