Code example for SQLException

0
        if (rowID > 0) {
            getContext().getContentResolver().notifyChange(Template.CONTENT_URI, null);
            return ContentUris.withAppendedId(Template.CONTENT_URI, rowID);
        } 
 
        throw new SQLException("Failed to insert row into " + uri);
    } 
 
    @Override 
    public int delete(Uri uri, String selection, String[] selectionArgs) {
        int count;
 
        if (sMatcher.match(uri) == TEMPLATES) {
            count = mDb.delete(TABLE_NAME, selection, selectionArgs);
        } 
        else { 
            String segment = uri.getPathSegments().get(1);
            count = mDb
                    .delete(TABLE_NAME, Template._ID + "="
                            + segment
Stop searching for code, let great code find you!  Add Codota to your java IDE