写一段安卓查询sqlite数据库的代码
时间: 2023-03-13 12:22:49 浏览: 89
android sqlite数据库 demo code
String sql = "SELECT * FROM Students";
Cursor cursor = db.rawQuery(sql, null);
if (cursor.moveToFirst()) {
do {
int id = cursor.getInt(0);
String name = cursor.getString(1);
} while(cursor.moveToNext());
}
cursor.close();
阅读全文