public CongregacaoBean getCongregacao() throws ClassNotFoundException, SQLException { Connection con = conexao.getConnection(); String sql = "SELECT * FROM congregacao"; Statement stat = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs = stat.executeQuery(sql); CongregacaoBean congregacaoBean = new CongregacaoBean(); while (rs.next()) { congregacaoBean.setIdCongregacao(rs.getInt("id_congregacao")); congregacaoBean.setNome(rs.getString("nome")); congregacaoBean.setCarisma(rs.getString("carisma")); congregacaoBean.setLema(rs.getString("lema")); congregacaoBean.setDataFundacao(rs.getString("data_fundacao")); congregacaoBean.setDataAgregacaoOrdem(rs.getString("data_agregacao_ordem")); congregacaoBean.setDataErecaoCanonica(rs.getString("data_erecao_canonica")); congregacaoBean.setFundador(rs.getString("fundador")); congregacaoBean.setCoFundador(rs.getString("co_fundador")); congregacaoBean.setCidadeFundacao(rs.getString("cidade_fundacao")); } rs.close(); stat.close(); con.close(); System.out.println(congregacaoBean.getIdCongregacao()); return congregacaoBean; }