public static Reservation createReservation(int userid, int eventid, Timestamp timereserved, Timestamp startTime, int slotnum) {
        try {
            if(getUserReservation(userid, eventid) != null){//just update the field
                Connection con = DB.getConnection();
                PreparedStatement ps = con.prepareStatement(UPDATERESERVATION, Statement.RETURN_GENERATED_KEYS);
                ps.setInt(1, slotnum);
                ps.setTimestamp(2, startTime);
                ps.setInt(3, userid);
                ps.setInt(4, eventid);
                int result = ps.executeUpdate();
                if(result > 0){
                    return new Reservation(1, userid, eventid, timereserved, startTime, slotnum); //id can be bogus, not used
                }
            } else {
                Connection con = DB.getConnection();
                PreparedStatement ps = con.prepareStatement(CREATERESERVATION, Statement.RETURN_GENERATED_KEYS);
                ps.setInt(1, userid);
                ps.setInt(2, eventid);
                ps.setTimestamp(3, timereserved);
                ps.setTimestamp(4, startTime);
                ps.setInt(5, slotnum);
                int result = ps.executeUpdate();
                ResultSet res = ps.getGeneratedKeys();
                if (res.next()) {
                    return new Reservation(res.getInt(1), userid, eventid, timereserved, startTime, slotnum);
                }
            }

        } catch (Exception ex) {
        }
        return null;
    }