thunder://QUFodHRwOi8vYWlrYW5keS5vcmcvMDXjgIrogIHnvZdBbmRyb2lk5byA5Y+R6KeG6aKR5pWZ56iL44CL56ys5LqU6ZuG77yaQW5kcm9pZOaTjeS9nOaVsOaNruW6k+S4iS5tcDQ/ZmlkPWRrcUwqdWV0Y0ZZc1JjNHZJYW5WSVVMWnZpWUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUEmbWlkPTY2NiZ0aHJlc2hvbGQ9MTUwJnRpZD1FNTFERDdCQzAxQTkyODJCQTc3RUMxQzNCRUIzQ0JGNyZzcmNpZD0xMjAmdmVybm89MVpa
别拿了资源不给分啊
android读取数据库可以使用sqlite一些api进行读取,实例如下:
/*** 查找一条数据
* @param uid
*/
public User find(Integer uid){
SQLiteDatabase db=dbOpenHelper.getReadableDatabase() //创建数据库辅助类
Cursor cursor =db.rawQuery("select * from user where uid=?", new String[]{uid.toString()}) //创建一个游标
if(cursor.moveToFirst()){ //循环遍历查找数组
int uid2=cursor.getInt(cursor.getColumnIndex("uid"))
String uname=cursor.getString(cursor.getColumnIndex("uname"))
String uaddress=cursor.getString(cursor.getColumnIndex("uaddress"))
User user=new User()
user.setUid(uid2)
user.setUname(uname)
user.setUaddress(uaddress)
return user
}
cursor.close()
return null
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)