Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 正在获取SQLite3。异常:数据库磁盘映像格式不正确_Android_Database_Sqlite_Android Sqlite - Fatal编程技术网

Android 正在获取SQLite3。异常:数据库磁盘映像格式不正确

Android 正在获取SQLite3。异常:数据库磁盘映像格式不正确,android,database,sqlite,android-sqlite,Android,Database,Sqlite,Android Sqlite,我试图从数据库中获取数据,我的数据库包含UTF8字符,执行此操作时,异常中出现“SQLite3.Exception:数据库磁盘映像格式不正确” 代码如下: public ArrayList<String> getDefinations(String query, int column_index) { ArrayList<String> words = new ArrayList<String>(); MatrixCursor mcursor = nul

我试图从数据库中获取数据,我的数据库包含UTF8字符,执行此操作时,异常中出现“SQLite3.Exception:数据库磁盘映像格式不正确”

代码如下:

 public ArrayList<String> getDefinations(String query, int column_index) 
 {
ArrayList<String> words = new ArrayList<String>();
MatrixCursor mcursor = null;
 try {
Stmt stmt = getDB2().prepare(query);
if (stmt.step()) {
stmt.get_cursor().moveToFirst();
mcursor = stmt.get_cursor();
try {
mcursor.moveToFirst();
 do {
 words.add(mcursor.getString(column_index));
   } while (mcursor.moveToNext());

 } catch (IndexOutOfBoundsException e) {
 if (MainActivity.logcat_status) {
 Log.e("Error", e + "");
  }
 }
}

} catch (Exception e) {
    // TODO Auto-generated catch block
    if (MainActivity.logcat_status) {
     Log.e("Error", e + "");
       }

     }
这是我在日志中得到的

 01-29 11:04:19.532: E/Error(2023): SQLite3.Exception: database disk image is malformed
01-29 11:04:19.544: E/dalvikvm(2023): JNI ERROR (app bug): accessed stale local reference      
  0x7f00001d (index 7 in a table of size 7)
 01-29 11:04:19.544: E/dalvikvm(2023): VM aborting
  01-29 11:04:19.544: A/libc(2023): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1),   
  thread 2023 (abdkosh.android)
请检查此链接,这可能也有帮助
 01-29 11:04:19.532: E/Error(2023): SQLite3.Exception: database disk image is malformed
01-29 11:04:19.544: E/dalvikvm(2023): JNI ERROR (app bug): accessed stale local reference      
  0x7f00001d (index 7 in a table of size 7)
 01-29 11:04:19.544: E/dalvikvm(2023): VM aborting
  01-29 11:04:19.544: A/libc(2023): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1),   
  thread 2023 (abdkosh.android)