public class LoginBean {

    /**
       PROPERTY: internetID.  This is a read-only property.  Its value can
       only be set by the <b>checkCookie</b> method.
     */
    private String internetID;
    public String getInternetID() { return internetID; }


    /**
       PROPERTY: resume.
     */
    public void setResume(Object resume) {

	byte[] bytes;
	if ( resume.getClass() == byte[].class ) {
	    bytes = (byte[]) resume;
        }
        else if ( resume.getClass() == InputStream.class ) {
	    InputStream in = (InputStream) resume;
	    byte[] stream_bytes = new byte[RESUME_SIZE_LIMIT];
	    try {
		int size = in.read(stream_bytes);
	    }
	    catch(IOException ex) {
		Logger.global.info("IO exception while reading from resume input stream.");
		return;
	    }
	    bytes = Arrays.copyOfRange(stream_bytes, 0, size-1);
	}
        else { 
	    Logger.global.info("Wrong resume class: " + resume.getClass());
	    return;
	}

        Blob resume_blob = new jdbcBlob(bytes);

        // Suppose the database has a table called 'users' with colums
        // 'resume' and 'id'.

	String sql = "UPDATE users SET resume = ? WHERE id = ?";

	try {
	    PreparedStatement statement = connection.prepareStatement(sql);
	    statement.setBlob(1, resume_blob);
	    statement.setString(2, internetID);  // bean property

	    statement.executeUpdate();
	}
	catch(SQLException ex) {
	    Logger.global.info("Error storing resume in database.");
	    ex.printStackTrace();
	}
    }
        

    /**
       Limit on size of uploaded resume.
     */
    private static final int RESUME_SIZE_LIMIT = 1000000; // or whatever

    public String checkCookie() { ... }

    ...

}