Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public ArrayList<Persona> mostrar(){
  2. ArrayList<Persona> listaContactos = new ArrayList<Persona>();
  3. ResultSet resultado = null;
  4. try {
  5. resultado = ins.executeQuery("Select NOMBRE, APELLIDO, CEDULA from agenda");
  6. while(resultado.next()){
  7. listaContactos.add(new Persona(resultado.getString("NOMBRE"), resultado.getString("APELLIDO"), resultado.getLong("CEDULA")));
  8. }
  9. } catch (SQLException e) {
  10. // TODO Auto-generated catch block
  11. e.printStackTrace();
  12. }
  13. return listaContactos;
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement