/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package prymenu;
import java.util.*;
/**
*
* @author Administrador
*/
public class CategoriaDao extends Conectar{
Vector lista=new Vector();
public Vector listCategoria(){
lista.removeAllElements();
try{
sql="select * from tg_categoria order by cod_categoria";
stmt=cn.createStatement();
rs=stmt.executeQuery(sql);
while(rs.next()){
CategoriaBean u=new CategoriaBean();
u.setCod_categoria(rs.getString("cod_categoria"));
u.setTxt_nombre(rs.getString("txt_categoria"));
lista.addElement(u);
}
rs.close();
stmt.close();
}catch(Exception e){
System.out.println("Error= "+e.getMessage());
}
return lista;
}
}
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario