Bonjour je viens vers vous car j'ai un problème avec ma base de donnée pour mon application android sur un motorola defy mini
quand j'ouvre la base de donnée avec une méthode open d'un classe personnelle , j'obtiens l'erreur sqlite_config failed error code = 21 this should never occur
par contre le fait troublant c'est que l'acces à la base de donnée marche parfaitement sur un htc wildfire s et l'emulateur android
je ne comprend pas cette erreur sur ce portable , si quelqu'un pouvais m'éclairer sur ce sujet

InterventionOpenHelper.java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
 
package com.example.telegestion;
 
 
 
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
 
public class InterventionOpenHelper extends SQLiteOpenHelper {
 
	// Version de la base de données
	private static final int DATABASE_VERSION = 3;
 
	//Nom de la Base
	private static final String TELEGESTION_BASE_NAME ="telegestion.db";
 
	//Nom de la table
	public static final String INTERVENTION_TABLE_NAME="Intervention";
 
	//Descriptions des colonnes
	public static final String COLUMN_IDLIGNE = "idligne";
	public static final int NUM_COLUMN_IDLIGNE=0;
	public static final String COLUMN_DATE_CREATION= "dateCreation";
	public static final int NUM_COLUMN_DATE_CREATION=1;
	public static final String COLUMN_HEURE_CREATION="heureCreation";
	public static final int NUM_COLUMN_HEURE_CREATION=2;
	public static final String COLUMN_CODE_ASSO="codeAsso";
	public static final int NUM_COLUMN_CODE_ASSO=3;	
	public static final String COLUMN_ID_PA="idPA";
	public static final int NUM_COLUMN_ID_PA=4;
	public static final String COLUMN_NOM_PRENOM= "nomPrenom";
	public static final int NUM_COLUMN_NOM_PRENOM=5;
	public static final String COLUMN_ACTION_CODE ="actionCode";
	public static final int NUM_COLUMN_ACTION_CODE=6;
	public static final String COLUMN_MOTIF_PAS_CODE ="motifPasCode";
	public static final int NUM_COLUMN_MOTIF_PAS_CODE=7;
	public static final String COLUMN_DATE_INTERVENTION ="dateIntervention";
	public static final int NUM_COLUMN_DATE_INTERVENTION=8;
	public static final String COLUMN_HEURE_INTERVENTION="heureIntervention";
	public static final int NUM_COLUMN_HEURE_INTERVENTION=9;
	public static final String COLUMN_CODE_PREST="codePrest";
	public static final int NUM_COLUMN_CODE_PREST=10;
	public static final String COLUMN_A_POSITIONNER="aPositionner";
	public static final int NUM_COLUMN_A_POSITIONNER=11; 
	public static final String COLUMN_LONGITUDE="longitude";
	public static final int NUM_COLUMN_LONGITUDE=12;
	public static final String COLUMN_LATTITUDE="lattitude";
	public static final int NUM_COLUMN_LATTITUDE=13;
	public static final String COLUMN_DATE_GPS="dateGPS";
	public static final int NUM_COLUMN_DATE_GPS=14;
	public static final String COLUMN_HEURE_GPS="heureGPS";
	public static final int NUM_COLUMN_HEURE_GPS=15;
	public static final String COLUMN_KM="km";
	public static final int NUM_COLUMN_KM=16;
	public static final String COLUMN_ANNULER="annuler";
	public static final int NUM_COLUMN_ANNULER=17;
	public static final String COLUMN_DATE_ANNULER="dateAnnuler";
	public static final int NUM_COLUMN_DATE_ANNULER=18;
	public static final String COLUMN_HEURE_ANNULER="heureAnnuler";
	public static final int NUM_COLUMN_HEURE_ANNULER=19;
	public static final String COLUMN_A_TRANSMETTRE="aTransmettre";
	public static final int NUM_COLUMN_A_TRANSMETTRE=20;
	public static final String COLUMN_DATE_TRANSMIS="dateTransmis";
	public static final int NUM_COLUMN_DATE_TRANSMIS=21;
	public static final String COLUMN_HEURE_TRANSMIS="heureTransmis";
	public static final int NUM_COLUMN_HEURE_TRANSMIS=22;
 
	public InterventionOpenHelper(Context context, CursorFactory factory) {
	    super(context, TELEGESTION_BASE_NAME, factory, DATABASE_VERSION);
	}
 
	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
 
		db.execSQL(REQUETE_CREATION_BDD);
 
	}
 
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		// Lorsque l'on change le numéro de version de la base on supprime la
		// table puis on la recrée
		/*if (newVersion > DATABASE_VERSION) {
			db.execSQL("DROP TABLE " + INTERVENTION_TABLE_NAME + ";");
		    onCreate(db);
		}*/
	}
 
	// Requête SQL pour la création da la base
	private static final String REQUETE_CREATION_BDD = 
			"CREATE TABLE "
		    + INTERVENTION_TABLE_NAME + " (" 
			+ COLUMN_IDLIGNE + " INTEGER PRIMARY KEY AUTOINCREMENT, " 
		    + COLUMN_DATE_CREATION + " TEXT NOT NULL, " 
		    + COLUMN_HEURE_CREATION + " TEXT NOT NULL, "
		    + COLUMN_CODE_ASSO + " TEXT NOT NULL, "
		    + COLUMN_ID_PA + " INTEGER NOT NULL, "
		    + COLUMN_NOM_PRENOM + " TEXT NOT NULL, "
		    + COLUMN_ACTION_CODE + " TEXT NOT NULL, "
		    + COLUMN_MOTIF_PAS_CODE + " TEXT NOT NULL, "
		    + COLUMN_DATE_INTERVENTION + " TEXT NOT NULL, "
		    + COLUMN_HEURE_INTERVENTION + " TEXT NOT NULL, "
		    + COLUMN_CODE_PREST + " TEXT NOT NULL, "
		    + COLUMN_A_POSITIONNER + " INTEGER NOT NULL, "
		    + COLUMN_LATTITUDE + " REAL NOT NULL, "
		    + COLUMN_LONGITUDE + " REAL NOT NULL, "
		    + COLUMN_DATE_GPS + " TEXT NOT NULL, "
		    + COLUMN_HEURE_GPS + " TEXT NOT NULL, "
		    + COLUMN_KM + " TEXT NOT NULL, "
		    + COLUMN_ANNULER + " INTEGER NOT NULL, "
		    + COLUMN_DATE_ANNULER + " TEXT NOT NULL, "
		    + COLUMN_HEURE_ANNULER + " TEXT NOT NULL, "
		    + COLUMN_A_TRANSMETTRE + " INTEGER NOT NULL, "
		    + COLUMN_DATE_TRANSMIS + " TEXT NOT NULL, "
		    + COLUMN_HEURE_TRANSMIS + " TEXT NOT NULL);";
 
}
InterventionRepository.java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
 
package com.example.telegestion;
 
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
 
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
 
public class InterventionRepository extends Repository<Intervention> {
 
	public InterventionRepository(Context context) {
		sqLiteOpenHelper = new InterventionOpenHelper(context, null);
	}
 
	@Override
	public List<Intervention> GetAll() {
		// TODO Auto-generated method stub
		Cursor cursor = maBDD.query(InterventionOpenHelper.INTERVENTION_TABLE_NAME,
									new String[] { 
									InterventionOpenHelper.COLUMN_IDLIGNE,
									InterventionOpenHelper.COLUMN_DATE_CREATION, 
								    InterventionOpenHelper.COLUMN_HEURE_CREATION,
								    InterventionOpenHelper.COLUMN_CODE_ASSO,
								    InterventionOpenHelper.COLUMN_ID_PA,
								    InterventionOpenHelper.COLUMN_NOM_PRENOM,
								    InterventionOpenHelper.COLUMN_ACTION_CODE,
								    InterventionOpenHelper.COLUMN_MOTIF_PAS_CODE,
								    InterventionOpenHelper.COLUMN_DATE_INTERVENTION,
								    InterventionOpenHelper.COLUMN_HEURE_INTERVENTION,
								    InterventionOpenHelper.COLUMN_CODE_PREST,
								    InterventionOpenHelper.COLUMN_A_POSITIONNER,
								    InterventionOpenHelper.COLUMN_LATTITUDE ,
								    InterventionOpenHelper.COLUMN_LONGITUDE,
								    InterventionOpenHelper.COLUMN_DATE_GPS,
								    InterventionOpenHelper.COLUMN_HEURE_GPS,
								    InterventionOpenHelper.COLUMN_KM,
								    InterventionOpenHelper.COLUMN_ANNULER,
								    InterventionOpenHelper.COLUMN_DATE_ANNULER,
								    InterventionOpenHelper.COLUMN_HEURE_ANNULER,
								    InterventionOpenHelper.COLUMN_A_TRANSMETTRE,
								    InterventionOpenHelper.COLUMN_DATE_TRANSMIS,
								    InterventionOpenHelper.COLUMN_HEURE_TRANSMIS
									}, 
									null, null, null,null, null);
 
		return ConvertCursorToListObject(cursor); 
	}
 
	@Override
	public Intervention GetById(int id) {
		Cursor cursor = maBDD.query(InterventionOpenHelper.INTERVENTION_TABLE_NAME,
				new String[] { 
				InterventionOpenHelper.COLUMN_IDLIGNE,
				InterventionOpenHelper.COLUMN_DATE_CREATION, 
			    InterventionOpenHelper.COLUMN_HEURE_CREATION,
			    InterventionOpenHelper.COLUMN_CODE_ASSO,
			    InterventionOpenHelper.COLUMN_ID_PA,
			    InterventionOpenHelper.COLUMN_NOM_PRENOM,
			    InterventionOpenHelper.COLUMN_ACTION_CODE,
			    InterventionOpenHelper.COLUMN_MOTIF_PAS_CODE,
			    InterventionOpenHelper.COLUMN_DATE_INTERVENTION,
			    InterventionOpenHelper.COLUMN_HEURE_INTERVENTION,
			    InterventionOpenHelper.COLUMN_CODE_PREST,
			    InterventionOpenHelper.COLUMN_A_POSITIONNER,
			    InterventionOpenHelper.COLUMN_LATTITUDE ,
			    InterventionOpenHelper.COLUMN_LONGITUDE,
			    InterventionOpenHelper.COLUMN_DATE_GPS,
			    InterventionOpenHelper.COLUMN_HEURE_GPS,
			    InterventionOpenHelper.COLUMN_KM,
			    InterventionOpenHelper.COLUMN_ANNULER,
			    InterventionOpenHelper.COLUMN_DATE_ANNULER,
			    InterventionOpenHelper.COLUMN_HEURE_ANNULER,
			    InterventionOpenHelper.COLUMN_A_TRANSMETTRE,
			    InterventionOpenHelper.COLUMN_DATE_TRANSMIS,
			    InterventionOpenHelper.COLUMN_HEURE_TRANSMIS
				}, 
				InterventionOpenHelper.COLUMN_IDLIGNE + "=?",
				new String[] { String.valueOf(id) }, 
				null,null, null);
 
		return ConvertCursorToObject(cursor);
	}
 
	@Override
	public void Save(Intervention entite) {
 
		DateFormat sfDate = new SimpleDateFormat("yyyy-MM-dd");
		DateFormat sfHeure = new SimpleDateFormat("HH:mm:ss");
 
		String sDateCreation = sfDate.format(entite.getDateCreation());
		String sHeureCreation = sfHeure.format(entite.getHeureCreation());
 
		String sDateInter = sfDate.format(entite.getDateIntervention());
		String sHeureInter = sfHeure.format(entite.getHeureIntervention());
 
		String sDateGPS = sfDate.format(entite.getDateGPS());
		String sHeureGPS = sfHeure.format(entite.getHeureGPS());
 
		String sDateAnnuler = sfDate.format(entite.getDateAnnuler());
		String sHeureAnnuler = sfHeure.format(entite.getHeureAnnuler());
 
		String sDateTransmis = sfDate.format(entite.getDateTransmis());
		String sHeureTransmis = sfHeure.format(entite.getHeureTransmis());
 
		// TODO Auto-generated method stub
		ContentValues contentValues = new ContentValues();
		contentValues.put(InterventionOpenHelper.COLUMN_IDLIGNE,entite.getIdLigne());
		contentValues.put(InterventionOpenHelper.COLUMN_DATE_CREATION,sDateCreation);
		contentValues.put(InterventionOpenHelper.COLUMN_HEURE_CREATION,sHeureCreation);
		contentValues.put(InterventionOpenHelper.COLUMN_CODE_ASSO,entite.getCodeAsso());
		contentValues.put(InterventionOpenHelper.COLUMN_ID_PA,entite.getIdPA());
		contentValues.put(InterventionOpenHelper.COLUMN_NOM_PRENOM,entite.getNomPrenom());
		contentValues.put(InterventionOpenHelper.COLUMN_ACTION_CODE,entite.getActionCode());
		contentValues.put(InterventionOpenHelper.COLUMN_MOTIF_PAS_CODE,entite.getMotifPasCode());
		contentValues.put(InterventionOpenHelper.COLUMN_DATE_INTERVENTION,sDateInter);
		contentValues.put(InterventionOpenHelper.COLUMN_HEURE_INTERVENTION,sHeureInter);
		contentValues.put(InterventionOpenHelper.COLUMN_CODE_PREST,entite.getCodePrest());
		contentValues.put(InterventionOpenHelper.COLUMN_A_POSITIONNER,entite.isaPositionner());
		contentValues.put(InterventionOpenHelper.COLUMN_LATTITUDE ,entite.getLattitude());
		contentValues.put(InterventionOpenHelper.COLUMN_LONGITUDE,entite.getLongitude());
		contentValues.put(InterventionOpenHelper.COLUMN_DATE_GPS,sDateGPS);
		contentValues.put(InterventionOpenHelper.COLUMN_HEURE_GPS,sHeureGPS);
		contentValues.put(InterventionOpenHelper.COLUMN_KM,entite.getKm());
		contentValues.put(InterventionOpenHelper.COLUMN_ANNULER,entite.isAnnuler());
		contentValues.put(InterventionOpenHelper.COLUMN_DATE_ANNULER,sDateAnnuler);
		contentValues.put(InterventionOpenHelper.COLUMN_HEURE_ANNULER,sHeureAnnuler);
		contentValues.put(InterventionOpenHelper.COLUMN_A_TRANSMETTRE,entite.isaTransmettre());
		contentValues.put(InterventionOpenHelper.COLUMN_DATE_TRANSMIS,sDateTransmis);
		contentValues.put(InterventionOpenHelper.COLUMN_HEURE_TRANSMIS,sHeureTransmis);		
		maBDD.insert(InterventionOpenHelper.INTERVENTION_TABLE_NAME, null, contentValues);
	}
 
	@Override
	public void Update(Intervention entite) {
		// TODO Auto-generated method stub
 
	}
 
	@Override
	public void Delete(int id) {
		// TODO Auto-generated method stub
		maBDD.delete(InterventionOpenHelper.INTERVENTION_TABLE_NAME,
				InterventionOpenHelper.COLUMN_IDLIGNE + "=?",
				new String[] { String.valueOf(id) });
	}
 
	@Override
	public List<Intervention> ConvertCursorToListObject(Cursor c) {
		List<Intervention> liste = new ArrayList<Intervention>();
 
		// Si la liste est vide
		if (c.getCount() == 0)
			return liste;
 
		// position sur le premier item
		c.moveToFirst();
 
		// Pour chaque item
		do {
 
			Intervention inter = ConvertCursorToObject(c);
 
			liste.add(inter);
		} while (c.moveToNext());
 
		// Fermeture du curseur
		c.close();
 
		return liste;
	}
 
	@Override
	public Intervention ConvertCursorToObject(Cursor c) {
		Intervention inter=null;
		try{
			Date cursorDateCrea = stringToDate(c.getString(InterventionOpenHelper.NUM_COLUMN_DATE_CREATION), "yyyy-MM-dd");
			Date cursorHeureCrea = stringToDate(c.getString(InterventionOpenHelper.NUM_COLUMN_HEURE_CREATION), "HH:mm:ss");
 
			Date cursorDateInter = stringToDate(c.getString(InterventionOpenHelper.NUM_COLUMN_DATE_INTERVENTION), "yyyy-MM-dd");
			Date cursorHeureInter = stringToDate(c.getString(InterventionOpenHelper.NUM_COLUMN_HEURE_INTERVENTION), "HH:mm:ss");
 
			Date cursorDateGPS = stringToDate(c.getString(InterventionOpenHelper.NUM_COLUMN_DATE_GPS), "yyyy-MM-dd");
			Date cursorHeureGPS = stringToDate(c.getString(InterventionOpenHelper.NUM_COLUMN_HEURE_GPS), "HH:mm:ss");
 
			Date cursorDateAnnuler = stringToDate(c.getString(InterventionOpenHelper.NUM_COLUMN_DATE_ANNULER), "yyyy-MM-dd");
			Date cursorHeureAnnuler = stringToDate(c.getString(InterventionOpenHelper.NUM_COLUMN_HEURE_ANNULER), "HH:mm:ss");
 
			Date cursorDateTransmis = stringToDate(c.getString(InterventionOpenHelper.NUM_COLUMN_DATE_TRANSMIS), "yyyy-MM-dd");
			Date cursorHeureTransmis = stringToDate(c.getString(InterventionOpenHelper.NUM_COLUMN_HEURE_TRANSMIS), "HH:mm:ss");
 
			inter = new Intervention(
					c.getInt(InterventionOpenHelper.NUM_COLUMN_IDLIGNE), 
					cursorDateCrea, 
					cursorHeureCrea,
					c.getString(InterventionOpenHelper.NUM_COLUMN_CODE_ASSO), 
					c.getInt(InterventionOpenHelper.NUM_COLUMN_ID_PA), 
					c.getString(InterventionOpenHelper.NUM_COLUMN_NOM_PRENOM), 
					c.getString(InterventionOpenHelper.NUM_COLUMN_ACTION_CODE),
					c.getString(InterventionOpenHelper.NUM_COLUMN_MOTIF_PAS_CODE),
					cursorDateInter, 
					cursorHeureInter,
					c.getString(InterventionOpenHelper.NUM_COLUMN_CODE_PREST), 
					c.getInt(InterventionOpenHelper.NUM_COLUMN_A_POSITIONNER)==1, 
					c.getDouble(InterventionOpenHelper.NUM_COLUMN_LONGITUDE),
					c.getDouble(InterventionOpenHelper.NUM_COLUMN_LATTITUDE), 
					cursorDateGPS, 
					cursorHeureGPS, 
					c.getString(InterventionOpenHelper.NUM_COLUMN_KM),
					c.getInt(InterventionOpenHelper.NUM_COLUMN_ANNULER)==1, 
					cursorDateAnnuler, 
					cursorHeureAnnuler,
					c.getInt(InterventionOpenHelper.NUM_COLUMN_A_TRANSMETTRE)==1, 
					cursorDateTransmis, 
					cursorHeureTransmis);
		}catch(Exception e){
			e.printStackTrace();
		}
 
		return inter;
	}
 
	@Override
	public Intervention ConvertCursorToOneObject(Cursor c) {
		c.moveToFirst();
 
		Intervention inter = ConvertCursorToObject(c);
 
		c.close();
		return inter;
	}
 
	public static Date stringToDate(String sDate, String sFormat) throws Exception {
        SimpleDateFormat sdf = new SimpleDateFormat(sFormat);
        return sdf.parse(sDate);
	} 
 
}
Repository.java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
package com.example.telegestion;
 
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
 
public abstract class Repository<T> implements IRepository<T> {
 
	// Base de données
	protected SQLiteDatabase maBDD;
 
	protected SQLiteOpenHelper sqLiteOpenHelper;
 
	public Repository(){
 
	}
 
 
	/**
        * Ouverture de la connection
        */
	public void Open() {
 
		try{
			maBDD = sqLiteOpenHelper.getWritableDatabase();
		}catch(Exception e){
 
			Log.e("Error", e.toString());
		}
	}
 
	/**
        * Fermeture de la connection
        */
	public void Close() {
	    maBDD.close();
	}
 
}
Si quelqu'un pouvait m'aider à ce sujet ce serait sympa

Merci par avance