读书人

android SQLite 查询数据时总查不到

发布时间: 2012-08-29 08:40:14 作者: rapoo

android SQLite 查询数据时总查不到,以前是可以的,求解啊!
// 查询的封装的方法
private Cursor select_All() {

SQLiteDatabase db = this.getReadableDatabase();

Cursor cursor = db
.query(TABLE_NAME, null, null, null, null, null, null);

db.close();
System.out.println("cursor="+cursor.getCount());
return cursor;
}

[解决办法]
db.close();
为什么要close?
[解决办法]
最好是将cursor中的数据遍历到集合里面,再close掉

读书人网 >Android

热点推荐