Code example for SQLException

0
        if (rowID > 0) {
            Uri _uri = ContentUris.withAppendedId(CONTENT_URI, rowID);
            getContext().getContentResolver().notifyChange(_uri, null);
            return _uri;
        } 
        throw new SQLException("Failed to insert row into " + uri);
    } 
 
    @Override 
    public int delete(Uri arg0, String arg1, String[] arg2) {
        // arg0 = uri 
        // arg1 = selection 
        // arg2 = selectionArgs 
        int count = 0;
        switch (uriMatcher.match(arg0)) {
            case VIBRATIONS:
                count = vibrationsDB.delete(
                        DATABASE_TABLE,
                        arg1,
                        arg2);
                break;