Code example for SQLiteException

0
     * @param db The database. 
     * @param oldVersion The old database version. 
     * @param newVersion The new database version. 
     */ 
    public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        throw new SQLiteException("Can't downgrade database from version " +
                oldVersion + " to " + newVersion);
    } 
 
    /** 
     * Called when the database has been opened.  The implementation 
     * should check {@link SQLiteDatabase#isReadOnly} before updating the 
     * database. 
     * 
     * @param db The database. 
     */ 
    public void onOpen(SQLiteDatabase db) {}
 
    private void lockDatabase(SQLiteDatabase db) {
        Class<? extends SQLiteDatabase> cls = mDatabase.getClass();
        try {