Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void ingresarDatos(){
- Connection miConexion=null;
- Statement st;
- Date fecha=pedidos.getBuscarfecha().getDate();
- ResultSet rs=BaseDatosProductos.dameTabla2("SELECT `Fecha`, `numPedido`, `Total`, `Productos` FROM `pedidos`"
- + " WHERE Fecha='"+fecha+"' ");
- try {
- miConexion=DriverManager.getConnection("jdbc:mysql://localhost:3306/productos_juanjo",
- "root", "quepasachavales3");
- st=miConexion.createStatement();
- while(rs.next()){
- tabla.addRow(new Object[]{rs.getDate("Fecha"), rs.getInt("numPedido"),
- rs.getDouble("Total"),rs.getString("Productos")});
- }
- pedidos.getTablaPedidos().setModel(tabla);
- } catch (SQLException ex) {
- Logger.getLogger(Pedidos.class.getName()).log(Level.SEVERE, null, ex);
- }
Add Comment
Please, Sign In to add comment