jeudi 7 janvier 2016

How to handle contentiously querying in android Sqlite database

I am deleting the student records continuously based on student enrollment id

i am having 1000 id's i am deleting continuously as shown below..

 for (int j = 0; j < feeDetailsArrayList.size(); j++) {
               FeeDetails feeDetails = feeDetailsArrayList.get(j);
                           dbHelper.deleteFeeDetailsTableRecords(feeDetails.getStudentEnrollmentId());
        }

public  void deleteFeeDuesTableRecords(String studentEnrollmentId){

    SQLiteDatabase db = this.getWritableDatabase();
    String selectQuery = "delete from "+ STUDENT_FEE_DUES_TABLE +" where "+ KEY_STUDENT_ENROLLMENT_ID + "  = " + "'" + studentEnrollmentId + "'";
    Cursor cursor = db.rawQuery(selectQuery, null);


}

It will shows following error

fillWindow() exception unable to open database file (code 14) android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14) at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method) at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:854) at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836)

what was the problem am not able to trace,can any one guide me Your response will be appreciated.

Aucun commentaire:

Enregistrer un commentaire