Code example for SQLiteException

0
        SQLiteDatabase db = null;
        try { 
            mIsInitializing = true;
            db = SQLiteDatabase.openDatabase(mDbFilePath, mFactory, SQLiteDatabase.OPEN_READONLY);
            if (db.getVersion() != mNewVersion) {
                throw new SQLiteException("Can't upgrade read-only database from version " +
                        db.getVersion() + " to " + mNewVersion + ": " + mDbFilePath);
            } 
 
            onOpen(db);
            Log.w(TAG, "Opened " + mDbFilePath + " in read-only mode");
            mDatabase = db;
            return mDatabase;
        } finally { 
            mIsInitializing = false;
            if (db != null && db != mDatabase) db.close();
        } 
    } 
 
    /** 
Contextual code suggestions in your IDE  Get Codota for Java