문제

if SQLiteDatabase.isDatabaseIntegrityOK() returns false, how do i get access to the 1-100 lines of logs the database is supposed to return?

I want to display the results of the integrity check in my Android app.

Thanks!

도움이 되었습니까?

해결책

Just execute the command yourself, and pretend that it's a SELECT:

Cursor cursor = db.rawQuery("PRAGMA integrity_check", null);
while (cursor.moveToNext()) {
    String s = cursor.getString(0);
    ...
}

다른 팁

Alternative using Android's DatabaseUtils:

StringBuilder sb = new StringBuilder();
DatabaseUtils.dumpCursor(db.rawQuery("PRAGMA integrity_check", null), sb);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top