没有这样的表:LTA_LONG_TABLES(代码1):,同时编译:INSERT INTO LTA_LONG_TABLES(longs,lat)VALUES(?,?)

时间:2016-07-15 05:00:43

标签: android android-studio

 android.database.sqlite.SQLiteException: no such table: LTA_LONG_TABLES (code 1): , while compiling: INSERT INTO LTA_LONG_TABLES(longs,lat) VALUES (?,?)

我如何解决它

enter image description here

enter image description here

这是logcat消息

07-15 04:47:32.778 356-357/? E/SocketStream: readFully was waiting for 161376 bytes, got 14480 
07-15 04:47:32.778 356-357/? E/SocketStream: readFully was waiting for 146896 bytes, got 16192 
07-15 04:47:32.778 356-357/? E/SocketStream: readFully was waiting for 130704 bytes, got 12768 
07-15 04:47:32.778 356-357/? E/SocketStream: readFully was waiting for 117936 bytes, got 16192 
07-15 04:47:32.778 356-357/? E/SocketStream: readFully was waiting for 101744 bytes, got 16192 
07-15 04:47:32.778 356-357/? E/SocketStream: readFully was waiting for 85552 bytes, got 3816 
07-15 04:47:32.782 356-357/? E/SocketStream: readFully was waiting for 81736 bytes, got 16192 
07-15 04:47:32.782 356-357/? E/SocketStream: readFully was waiting for 65544 bytes, got 16192 
07-15 04:47:32.782 356-357/? E/SocketStream: readFully was waiting for 49352 bytes, got 11056 
07-15 04:47:32.782 356-357/? E/SocketStream: readFully was waiting for 38296 bytes, got 16192 
07-15 04:47:32.782 356-357/? E/SocketStream: readFully was waiting for 22104 bytes, got 16192 
07-15 04:47:33.006 10645-10645/com.womansera.confession.mylatlong E/SQLiteLog: (1) no such table: LTA_LONG_TABLES
07-15 04:47:33.006 10645-10645/com.womansera.confession.mylatlong E/SQLiteDatabase: Error inserting longs=New Latitude: 28.613938333333333 lat=New Longitude: 77.20902
  

android.database.sqlite.SQLiteException:没有这样的表:   LTA_LONG_TABLES(代码1):,编译时:INSERT INTO   LTA_LONG_TABLES(longs,lat)VALUES(?,?)at   android.database.sqlite.SQLiteConnection.nativePrepareStatement(母语   方法)at   android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:882)   在   android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:493)   在   android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)   在android.database.sqlite.SQLiteProgram。(SQLiteProgram.java:58)   在   android.database.sqlite.SQLiteStatement。(SQLiteStatement.java:31)   在   android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1467)   在   android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1339)   在   com.womansera.confession.mylatlong.DbHelper.insertData(DbHelper.java:51)   在   com.womansera.confession.mylatlong.MainActivity.onLocationChanged(MainActivity.java:41)   在   android.location.LocationManager $ ListenerTransport._handleMessage(LocationManager.java:234)   在   android.location.LocationManager $ ListenerTransport.access $ 000(LocationManager.java:167)   在   android.location.LocationManager $ ListenerTransport $ 1.handleMessage(LocationManager.java:183)                                                                                在android.os.Handler.dispatchMessage(Handler.java:99)at   android.os.Looper.loop(Looper.java:137)at   android.app.ActivityThread.main(ActivityThread.java:4745)at   java.lang.reflect.Method.invokeNative(Native Method)at   java.lang.reflect.Method.invoke(Method.java:511)at   com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:786)   在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)at   dalvik.system.NativeStart.main(本机方法)       07-15 04:47:33.066 10645-10645 / com.womansera.confession.mylatlong E / SocketStream:readFully等待6528字节,得到2896

1 个答案:

答案 0 :(得分:0)

创建表时尝试添加, db.execSQL(“create table latlong”+“(纬度文本,经度文本)”);

希望这会对你有所帮助。