@Override
    public List<Player> selectPlayerofMatchByCourtByDayByHour(int terrain, int day, int heure) throws SQLException, IOException {
        connexionDB = ConnexionMysqlFactory.getInstance();
        ResultSet rs = null;
        List<Player> lp = new ArrayList<>();
        Statement st = connexionDB.createStatement();
        try (PreparedStatement ps = connexionDB.prepareStatement("select * from pulp.player where playerId in (select idP1 from pulp.attribmatch where matchId in "
                + "(select matchId from pulp.match where matchLieu=? and matchDate=? and matchTrancheHoraire=?))")) {
            
            ps.setInt(1, terrain);
            ps.setInt(2, day);
            ps.setInt(2, heure);
            
            try {
                rs = ps.executeQuery();
                while (rs.next()) {
                    lp.add(new Player(rs.getInt(1), rs.getString(2), rs.getString(3), rs.getString(4), rs.getInt(5)));
                }
            } catch (SQLException e) {
                System.err.println(e.getMessage());
            }
        }
        try (PreparedStatement ps = connexionDB.prepareStatement("select * from pulp.player where playerId in (select idP2 from pulp.attribmatch where matchId in "
                + "(select matchId from pulp.match where matchLieu=? and matchDate=? and matchTrancheHoraire=?))")) {
            ps.setInt(1, terrain);
            ps.setInt(2, day);
            ps.setInt(2, heure);
            try {
                rs = ps.executeQuery();
                while (rs.next()) {
                    lp.add(new Player(rs.getInt(1), rs.getString(2), rs.getString(3), rs.getString(4), rs.getInt(5)));
                }
            } catch (SQLException e) {
                System.err.println(e.getMessage());
            }
        }
        connexionDB.close();
        return lp;
    }