SQLite创建数据库while compiling: testsystem.db 2C

android.database.sqlite.SQLiteException: near "testsystem": syntax error (code 1): , while compiling: testsystem.db
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:887)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:498)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:58)
at android.database.sqlite.SQLiteStatement.(SQLiteStatement.java:31)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1674)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1605)
at com.gggd.sunny.testsystem.tools.DBOpenHelper.onCreate(DBOpenHelper.java:63)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:251)
at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
at com.gggd.sunny.testsystem.tools.LibraryAndTestDB.(LibraryAndTestDB.java:21)
at com.gggd.sunny.testsystem.MakeTestModeActivity.insertData(MakeTestModeActivity.java:217)
at com.gggd.sunny.testsystem.MakeTestModeActivity$2.onClick(MakeTestModeActivity.java:181)
at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:163)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5527)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)

4个回答

你创建数据库的sql脚本有错误,错误临近 "testsystem" 这个单词附近,自己检查下。

luoz_java
luoz_python 改了数据库名后面莫名成了
接近 3 年之前 回复

就是那个词附近有语法错误,检查一下单词以及单引号双引号的

检查带testsystem的sql语句吧

建库的SQL脚步错误、

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐