public static EventAssignment assignUser(int eventid, int userid, int adminid, Timestamp timestamp){
        try {
            Connection con = DB.getConnection();
            PreparedStatement ps = con.prepareStatement(ASSIGNUSER, Statement.RETURN_GENERATED_KEYS);
            ps.setInt(1, eventid);
            ps.setInt(2, userid);
            ps.setInt(3, adminid);
            ps.setTimestamp(4, timestamp);
            int result = ps.executeUpdate();
            ResultSet res = ps.getGeneratedKeys(); //to retrieve the id
            if(res.next()){
                return new EventAssignment(res.getInt(1), eventid, userid, adminid, timestamp, 0);
            }            
        } catch(Exception ex){ 
        ex.printStackTrace();}
        return null;
    }