Advertisement
DevMakoto

lol

Nov 23rd, 2015
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. void cargarlistaproductos(String dato){
  2. String [] Titulo = {"Codigo","Descripcion","Heroe","Rareza","Precio","Stock"};
  3. tabla=new DefaultTableModel(null,Titulo);
  4. String []Registro= new String[6];
  5. String mostrar="SELECT * FROM articulo WHERE CONCAT (cod_art,nom_art,hero_art,nom_art) LIKE '%"+dato+"%'";
  6. Conexion db = new Conexion();
  7. try {
  8. ResultSet rs = db.Consulta(mostrar);
  9. while(rs.next())
  10. {
  11. Registro[0]=rs.getString("cod_art");
  12. Registro[1]=rs.getString("nom_art");
  13. Registro[2]=rs.getString("hero_art");
  14. Registro[3]=rs.getString("rare_art");
  15. Registro[4]=rs.getString("precio_art");
  16. Registro[5]=rs.getString("stock_art");
  17.  
  18. tabla.addRow(Registro);
  19. }
  20. tableArticulos.setModel(tabla);
  21. } catch (SQLException ex) {
  22. System.out.println(ex);
  23. }
  24.  
  25.  
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement