public static ArrayList<Match> getMatchAfterTime(Timestamp nowTime, int searchType, String stringToSearch, Timestamp thisTime) {
        ArrayList<Match> availableMatch = new ArrayList<Match>();
        try {
            String sql = ("SELECT match.match_id, match.match_name, match.command1, " +
                    "match.command2, match.datetime, match.stadium_id, stadium.stadium_name, stadium.about, stadium.pic_name \n" +
                    "FROM match\n" +
                    "JOIN stadium ON (match.stadium_id = stadium.stadium_id)\n" +
                    "WHERE datetime >=  ?\n");
            PreparedStatement pr = null;
            switch (searchType) {
                case 1: {
                    sql += "AND to_char (match.datetime, 'yyyy') = ? AND to_char (match.datetime, 'mm') = ? AND to_char (match.datetime, 'dd') = ?";
                    pr = connection.prepareStatement(sql);
                    Calendar cal = Calendar.getInstance();
                    cal.setTimeInMillis(thisTime.getTime());
                    pr.setString(2, String.valueOf(cal.get(Calendar.YEAR)));
                    pr.setString(3, String.valueOf(cal.get(Calendar.MONTH) + 1));
                    pr.setString(4, String.valueOf(cal.get(Calendar.DAY_OF_MONTH)));
                    break;
                }
                case 2: {
                    sql += "AND (UPPER(match.match_name) LIKE UPPER(?) OR UPPER(match.command1) LIKE UPPER(?) OR " +
                            "UPPER(match.command1) LIKE UPPER(?) OR " +
                            "UPPER(stadium.stadium_name) LIKE UPPER(?))";
                    pr = connection.prepareStatement(sql);
                    pr.setString(2, "%" + stringToSearch + "%");
                    pr.setString(3, "%" + stringToSearch + "%");
                    pr.setString(4, "%" + stringToSearch + "%");
                    pr.setString(5, "%" + stringToSearch + "%");
                    break;
                }
                default: {
                    pr = connection.prepareStatement(sql);
                    break;
                }
            }
            pr.setTimestamp(1, nowTime);
            ResultSet rs = pr.executeQuery();
            while (rs.next()) {
                int match_id = rs.getInt(1);
                String match_name = rs.getString(2);
                String command1 = rs.getString(3);
                String command2 = rs.getString(4);
                Timestamp dateTime = rs.getTimestamp(5);
                int stadium_id = rs.getInt(6);
                String stadium_name = rs.getString(7);
                String about = rs.getString(8);
                String pic_name = rs.getString(9);

                Stadium stadium = new Stadium(stadium_id, stadium_name, about, pic_name);

                Match match = new Match(match_id, match_name, command1, command2, dateTime, stadium);
                availableMatch.add(match);
            }
            rs.close();
            pr.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return availableMatch;
    }