Advertisement
Guest User

maneged

a guest
Dec 6th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. package bean;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.PreparedStatement;
  5. import java.sql.ResultSet;
  6. import java.sql.SQLException;
  7. import java.util.ArrayList;
  8. import java.util.Date;
  9. import java.util.List;
  10.  
  11. import javax.faces.bean.ManagedBean;
  12.  
  13. import conexao.ConexaoBD;
  14. import pessoa.dao.PessoaDao;
  15. import pessoa.implement.PessoaImplements;
  16. import edu.Entidade.Pessoa;
  17.  
  18.  
  19.  
  20. @ManagedBean
  21. public class PessoaMB {
  22.  
  23.  
  24. private Pessoa pessoa = new Pessoa();
  25. PessoaDao aDao = new PessoaImplements();
  26. private List<Pessoa> resul;
  27.  
  28.  
  29.  
  30.  
  31.  
  32. public Pessoa getPessoa() {
  33. return pessoa;
  34. }
  35.  
  36. public void setPessoa(Pessoa pessoa) {
  37. this.pessoa = pessoa;
  38. }
  39.  
  40.  
  41.  
  42.  
  43.  
  44. public void inserir() throws SQLException{
  45.  
  46. System.out.println("Gravandooooo");
  47.  
  48.  
  49. aDao.inserir(pessoa);
  50.  
  51.  
  52.  
  53. }
  54.  
  55.  
  56. public List<Pessoa> getListar() throws SQLException{
  57.  
  58.  
  59.  
  60. resul = aDao.lista();
  61.  
  62.  
  63. return resul;
  64.  
  65. }
  66.  
  67.  
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement