Code example for SQLiteDatabase

Methods: execSQLrawQuery

0
                ");"); 
    } 
 
    private void addVersion50Events() { 
        // April 5th 1:01:01 AM to April 6th 1:01:01 
        mBadDb.execSQL("INSERT INTO Events (_id,dtstart,dtend,duration," +
                "eventTimezone,allDay,calendar_id) " + 
                "VALUES (1,1270454471000,1270540872000,'P10S'," + 
                "'America/Los_Angeles',1,1);"); 
 
        // April 5th midnight to April 6th midnight, duration cleared 
        mGoodDb.execSQL("INSERT INTO Events (_id,dtstart,dtend,duration," +
                "eventTimezone,allDay,calendar_id) " + 
                "VALUES (1,1270425600000,1270512000000,null," + 
                "'UTC',1,1);"); 
 
        // April 5th 1:01:01 AM to April 6th 1:01:01, recurring weekly (We only check for the 
        // existence of an rrule so it doesn't matter if the day is correct) 
        mBadDb.execSQL("INSERT INTO Events (_id,dtstart,dtend,duration," +
                "eventTimezone,allDay,rrule,calendar_id) " + 
                "VALUES (2,1270454462000,1270540863000," + 
                "'P10S','America/Los_Angeles',1," + 
                "'WEEKLY:MON',1);"); 
 
        // April 5th midnight with 1 day duration, if only dtend was wrong we wouldn't fix it, but 
        // if anything else is wrong we clear dtend to be sure. 
        mGoodDb.execSQL("INSERT INTO Events (" +
                "_id,dtstart,dtend,duration," + 
                "eventTimezone,allDay,rrule,calendar_id)" + 
                "VALUES (2,1270425600000,null,'P1D'," + 
                "'UTC',1," + 
                "'WEEKLY:MON',1);"); 
 
        assertEquals(mBadDb.rawQuery("SELECT _id FROM Events;", null).getCount(), 2);
        assertEquals(mGoodDb.rawQuery("SELECT _id FROM Events;", null).getCount(), 2);
    } 
 
    private void addVersion67Events() { 
        // April 5th 1:01:01 AM to April 6th 1:01:01