db.execSQL("CREATE TABLE RECOME_COFFEE_SHOP("
+"SHOP_ID INTEGER PRIMARY KEY,"
+"SHOP_NAME TEXT,SHOP_PLACE TEXT,"
+"SHOP_TEL INTEGER,SHOP_IMAGE_NAME INTEGER)");
db.execSQL("INSERT INTO RECOME_COFFEE_SHOP VALUES (1,"
+"\"左岸咖啡店\",\"星海广场001号\",101010101010,R.drawable_img_coffee_01)");
db.execSQL("INSERT INTO RECOME_COFFEE_SHOP VALUES (2,"
+"\"漫猫咖啡店\",\"中山区无名街002号\",101010101010,R.drawable_img_coffee_02)");
db.execSQL("INSERT INTO RECOME_COFFEE_SHOP VALUES (3,"
+"\"星巴克咖啡店\",\"甘井子区数码路北段18-25号\",101010101010,R.drawable_img_coffee_03)");
db.execSQL("INSERT INTO RECOME_COFFEE_SHOP VALUES (4,"
+"\"萌克思维主题咖啡店\",\"甘井子区软件园路144号\",101010101010,R.drawable_img_coffee_04)");
System.out.println("CREATE RECOME_COFFEE_SHOP");
这是我创建的数据库代码,然后运行的时候报错了,错误如下:
android.database.sqlite.SQLiteException: unrecognized token: ".0x7f020032" (code 1): , while compiling: INSERT INTO RECOME_COFFEE_SHOP VALUES (1,"左岸咖啡店","星海广场001号",101010101010,R.id.0x7f020032)
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
+"SHOP_ID INTEGER PRIMARY KEY,"
+"SHOP_NAME TEXT,SHOP_PLACE TEXT,"
+"SHOP_TEL INTEGER,SHOP_IMAGE_NAME INTEGER)");
db.execSQL("INSERT INTO RECOME_COFFEE_SHOP VALUES (1,"
+"\"左岸咖啡店\",\"星海广场001号\",101010101010,R.drawable_img_coffee_01)");
db.execSQL("INSERT INTO RECOME_COFFEE_SHOP VALUES (2,"
+"\"漫猫咖啡店\",\"中山区无名街002号\",101010101010,R.drawable_img_coffee_02)");
db.execSQL("INSERT INTO RECOME_COFFEE_SHOP VALUES (3,"
+"\"星巴克咖啡店\",\"甘井子区数码路北段18-25号\",101010101010,R.drawable_img_coffee_03)");
db.execSQL("INSERT INTO RECOME_COFFEE_SHOP VALUES (4,"
+"\"萌克思维主题咖啡店\",\"甘井子区软件园路144号\",101010101010,R.drawable_img_coffee_04)");
System.out.println("CREATE RECOME_COFFEE_SHOP");
这是我创建的数据库代码,然后运行的时候报错了,错误如下:
android.database.sqlite.SQLiteException: unrecognized token: ".0x7f020032" (code 1): , while compiling: INSERT INTO RECOME_COFFEE_SHOP VALUES (1,"左岸咖啡店","星海广场001号",101010101010,R.id.0x7f020032)
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)