Olá pessoal
Tenho uma classe java que me retorno um ArrayList e nesse array list tem um VO com duas colunas USUARIO e SENHA.
COMO SEGUE:
public class UsuarioDAO extends DAO {
public UsuarioDAO() {
}
public ArrayList pesquisaUsuarios(){
ArrayList pesquisa = new ArrayList();
Usuariovo[] usuariovos = null;
try {
for (int i = 0; i < 10; i++) {
UsuForm usuariovo = new UsuForm();
usuariovo.setUsuario("USUARIO" + i);
usuariovo.setSenha("SENHA" + i );
pesquisa.add(usuariovo);
}
} catch (Exception e) {
System.err.println("Exception: " + e.getMessage());
} finally {
}
return pesquisa;
}
}
NO MEU ACTION ESTOU EXECUTANDO O METHODO E RETORNO O
ARRAYLIST COM O SIZE CORRETO OU SEJA ESTÁ RETORNANDO O TOTAL DE REGISTRO CORRETO, POREM EU GOSTARIA DE LER AS COLUNAS DO VO QUE SE CHAMA USUARIO E SENHA.
//ESECUTANDO O METHODO
UsuarioDAO userDAO = new UsuarioDAO();
ArrayList pesquisa = userDAO.pesquisaUsuarios();
//GOSTARIA DE LER O VO AQUI NESSE PONTO NÃO SEI SE A MELHOR MANEIRA É LER ATRAVÉZ DE UM FOR OU SE POR INTERATOR.
for (int i = 0; i < pesquisa.size(); i++) {
log.info(" " + " - lendo o arrayList no action : " + pesquisa.size() );
}
MINHA DUVIDA É COMO LER ESSAS DUAS COLUNAS DESSE VO?
GRATO
SILVA
