Error Inserting [Android]
SALUT a tous. lorsque j'essaie d’insérer des positions de géolocalisation dans une base de données sqlite , Androïde me renvoi l'erreur suivante :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
06-13 15:02:31.778: E/Database(1893): Error inserting precision=3002.0 fournisseur=network direction=0.0 altitude=0.0 vitesse=0.0 longitude=9.699211033333334 latitude=4.0454574333333335 date=2013-06-13 15:02:25
06-13 15:02:31.778: E/Database(1893): android.database.sqlite.SQLiteException: table localisation has no column named fournisseur: , while compiling: INSERT INTO localisation(precision, fournisseur, direction, altitude, vitesse, longitude, latitude, date) VALUES(?, ?, ?, ?, ?, ?, ?, ?);
06-13 15:02:31.778: E/Database(1893): at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
06-13 15:02:31.778: E/Database(1893): at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
06-13 15:02:31.778: E/Database(1893): at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64)
06-13 15:02:31.778: E/Database(1893): at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:80)
06-13 15:02:31.778: E/Database(1893): at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:36)
06-13 15:02:31.778: E/Database(1893): at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1145)
06-13 15:02:31.778: E/Database(1893): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1536)
06-13 15:02:31.778: E/Database(1893): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1410)
06-13 15:02:31.778: E/Database(1893): at com.gps.localisation.CoordonneesBD.insertCoordonnees(CoordonneesBD.java:78)
06-13 15:02:31.778: E/Database(1893): at com.gps.localisation.Receive.StoreData(Receive.java:259)
06-13 15:02:31.778: E/Database(1893): at com.gps.localisation.Receive$2$1.run(Receive.java:153)
06-13 15:02:31.778: E/Database(1893): at android.os.Handler.handleCallback(Handler.java:587)
06-13 15:02:31.778: E/Database(1893): at android.os.Handler.dispatchMessage(Handler.java:92)
06-13 15:02:31.778: E/Database(1893): at android.os.Looper.loop(Looper.java:123)
06-13 15:02:31.778: E/Database(1893): at android.app.ActivityThread.main(ActivityThread.java:4627)
06-13 15:02:31.778: E/Database(1893): at java.lang.reflect.Method.invokeNative(Native Method)
06-13 15:02:31.778: E/Database(1893): at java.lang.reflect.Method.invoke(Method.java:521)
06-13 15:02:31.778: E/Database(1893): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:885)
06-13 15:02:31.778: E/Database(1893): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
06-13 15:02:31.778: E/Database(1893): at dalvik.system.NativeStart.main(Native Method) |
je pense qu'il me dit que je n'ai pas de colonne fournisseur dans la bd localisation . or c'est faux , j'ai bien une colonne fournisseur dans ma base de donnée. Aidez moi a interpréter cette erreur .
Scritp de creation de la table
salut a tous . voici mon script permettant de creer ma table
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
public static final String METIER_TABLE_CREATE = "CREATE TABLE " + METIER_TABLE_NAME + "(" + METIER_KEY + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ METIER_LATITUDE + " REAL ,"
+ METIER_LONGITUDE + " REAL ,"
+ METIER_ALTITUDE + " REAL ,"
+ METIER_PRECISION + " REAL ,"
+ METIER_VITESSE + " REAL ,"
+ METIER_DIRECTION + " REAL ,"
+ METIER_FOURNISSEUR + "TEXT ,"
+ METIER_DATE + " TEXT "
+");"; |
voici l’exécution :
Code:
1 2 3 4 5 6
|
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(METIER_TABLE_CREATE);
} |
le script permettant l'insertion des données
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
public long insertCoordonnees(Coordonnees m){
ContentValues value = new ContentValues();
)
value.put(CoordonneesBD.METIER_LATITUDE, m.getLatitude());
value.put(CoordonneesBD.METIER_LONGITUDE, m.getLongitude());
value.put(CoordonneesBD.METIER_ALTITUDE, m.getAltitude());
value.put(CoordonneesBD.METIER_PRECISION, m.getPrecision());
value.put(CoordonneesBD.METIER_VITESSE, m.getVitesse());
value.put(CoordonneesBD.METIER_FOURNISSEUR, m.getFournisseur());
value.put(CoordonneesBD.METIER_DIRECTION, m.getDirection());
value.put(CoordonneesBD.METIER_DATE, m.getDate());
return this.bdd.insert(TABLE_NAME, null, value);
} |
ou se situe le probleme ?