@Override
    public Competicao get(Object key) {
        try {
            Competicao al = null;
            Statement stm = conn.createStatement();
            String sql = "SELECT Competicao.*,Torneio.* FROM Torneio,competicao WHERE Torneio.Cod_Torneio='" + (String) key + "'and competicao.cod_competicao=torneio.cod_torneio";
            ResultSet rs = stm.executeQuery(sql);
            if (rs.next()){ 
                if(rs.getInt("tipotorneio")==0) {
                al = new Eliminatorias(rs.getString(1), rs.getString(2), rs.getString(3), rs.getString(4));
                rs.close();
                return al;
            } else {
                if(rs.getInt("tipotorneio")==1){
                 al = new EliminatoriaDupla(rs.getString(1), rs.getString(2), rs.getString(3), rs.getString(4)); 
                 rs.close();
                 return al;
                }
                }
            }
                sql = "SELECT Competicao.*,Campeonato.* FROM Campeonato,competicao WHERE Campeonato.Cod_Campeonato='" + (String) key + "'and competicao.cod_competicao=Campeonato.cod_campeonato";
                rs = stm.executeQuery(sql);
                if (rs.next()) {
                    al = new Campeonato(rs.getString(1), rs.getString(2), rs.getString(3), rs.getString(4));
                    rs.close();
                }
            
            
            return al;
        } catch (SQLException | NumberFormatException e) {
            JOptionPane.showMessageDialog(null, e.getMessage(), "ERROR", JOptionPane.ERROR_MESSAGE);
            return null;
        }
    }