Code example for SQLException

0
		if (rowId > 0) {
			Uri noteUri = ContentUris.withAppendedId(uri, rowId);
			getContext().getContentResolver().notifyChange(noteUri, null);
			return noteUri;
		} else 
			throw new SQLException("Failed to insert row into " + uri);
	} 
 
	 
	@Override 
	public int delete(Uri uri, String selection, String[] selectionArgs) {		
		final SQLiteDatabase db = dbHelper.getWritableDatabase();
		final SelectionBuilder builder = buildSelectionFromUri(uri);
		int count = builder.where(selection, selectionArgs).delete(db);
		getContext().getContentResolver().notifyChange(uri, null);
		return count;
	} 
	 
	@Override 
	public int update(Uri uri, ContentValues values, String selection,
			String[] selectionArgs) {