@Override
    public List<Convenio> listAll() {
        Connection con = null;
        PreparedStatement pstm = null;
        ResultSet rs = null;
        
        List<Convenio> convenio = new ArrayList<>();
        
        try{
            con = ConnectionFactory.getConnection();
            pstm = con.prepareStatement(LIST);
            rs = pstm.executeQuery();
            while(rs.next()){
            
                Convenio f = new Convenio();
                f.setNome(rs.getString("nome"));
                f.setCodigo(rs.getInt("codigo"));
                convenio.add(f);
            
            }
            
        }catch(Exception e){
            JOptionPane.showMessageDialog(null,"Erro ao listar convenios(all): " + e.getMessage());
        }finally{
            try{
                ConnectionFactory.closeConnection(con, pstm, rs);
            }catch(Exception e){
            JOptionPane.showMessageDialog(null,"Erro ao fechar conexão de listar convenio: " + e.getMessage());   
            }
        }
        return convenio;
    }