Code example for SQLiteException

0
		SQLiteDatabase db = null;
		try { 
			mIsInitializing = true;
			db = SQLiteDatabase.openDatabase(dbPathToUse, null, SQLiteDatabase.OPEN_READONLY);
			if (db.getVersion() != DATABASE_VERSION) {
				throw new SQLiteException("Can't upgrade read-only database from version " + db.getVersion() + " to "
						+ DATABASE_VERSION + ": " + dbPathToUse);
			} 
 
			onOpen(db);
			Log.w(TAG, "Opened " + DATABASE_NAME + " in read-only mode");
			mDatabase = db;
			return mDatabase;
		} finally { 
			mIsInitializing = false;
			if (db != null && db != mDatabase)
				db.close();
		} 
	}