Guest User

Untitled

a guest
Feb 18th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. public void ingresarDatos(){
  2. Connection miConexion=null;
  3. Statement st;
  4.  
  5. Date fecha=pedidos.getBuscarfecha().getDate();
  6.  
  7. ResultSet rs=BaseDatosProductos.dameTabla2("SELECT `Fecha`, `numPedido`, `Total`, `Productos` FROM `pedidos`"
  8. + " WHERE Fecha='"+fecha+"' ");
  9. try {
  10. miConexion=DriverManager.getConnection("jdbc:mysql://localhost:3306/productos_juanjo",
  11. "root", "quepasachavales3");
  12. st=miConexion.createStatement();
  13. while(rs.next()){
  14.  
  15. tabla.addRow(new Object[]{rs.getDate("Fecha"), rs.getInt("numPedido"),
  16. rs.getDouble("Total"),rs.getString("Productos")});
  17.  
  18. }
  19. pedidos.getTablaPedidos().setModel(tabla);
  20. } catch (SQLException ex) {
  21. Logger.getLogger(Pedidos.class.getName()).log(Level.SEVERE, null, ex);
  22. }
Add Comment
Please, Sign In to add comment