@Override
    public Element updateVCard(String username, Element vCardElement) throws NotFoundException {
        if (loadVCard(username) == null) {
            // The user does not have a vCard
            throw new NotFoundException("Username " + username + " does not have a vCard");
        }

        if ( JiveGlobals.getBooleanProperty( PhotoResizer.PROPERTY_RESIZE_ON_CREATE, PhotoResizer.PROPERTY_RESIZE_ON_CREATE_DEFAULT ) )
        {
            PhotoResizer.resizeAvatar( vCardElement );
        }

        Connection con = null;
        PreparedStatement pstmt = null;
        try {
            con = DbConnectionManager.getConnection();
            pstmt = con.prepareStatement(UPDATE_PROPERTIES);
            pstmt.setString(1, vCardElement.asXML());
            pstmt.setString(2, username);
            pstmt.executeUpdate();
        }
        catch (SQLException e) {
            Log.error("Error updating vCard of username: " + username, e);
        }
        finally {
            DbConnectionManager.closeConnection(pstmt, con);
        }
        return vCardElement;
    }
Default implementation of the VCardProvider interface, which reads and writes data
from the {@code ofVCard} database table.

@author Gaston Dombiak
xmppserver/src/main/java/org/jivesoftware/openfire/vcard/DefaultVCardProvider.java