Advertisement
Metziop

Untitled

May 20th, 2021
738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.32 KB | None | 0 0
  1. private void btnStartActionPerformed(java.awt.event.ActionEvent evt) {                                        
  2.      
  3.         this.btnStart.setEnabled(false);
  4.         this.btnStop.setEnabled(true);
  5.         int fila = jtAsignaciones.getSelectedRow();
  6.         String idTrabajo = jtAsignaciones.getValueAt(fila, 0).toString();
  7.         String tiempoEstimado = jtAsignaciones.getValueAt(fila, 2).toString();
  8.        
  9.         //----------------parte sql--------------------//
  10.  
  11.         try {
  12.  
  13.            
  14.             String querry = "UPDATE pedidosempleado SET horaInicio=?, estatus=? WHERE idPedidoEmpleado=?";
  15.             String estatus = "en elaboracion";
  16.             Connection conn = MySQLConection.getConnection();
  17.             PreparedStatement ps = conn.prepareStatement(querry);
  18.             ps.setTime(1, Time.valueOf(LocalTime.now()));
  19.             ps.setString(2, estatus);
  20.             ps.setString(3, idTrabajo);
  21.             ps.executeUpdate();
  22.  
  23.         } catch (Exception e) {
  24.             JOptionPane.showMessageDialog(null, "error" + e);
  25.         }
  26.           //----------------llamando al hilo--------------------//
  27.         cronometro crono = new cronometro(00, 00, 00);
  28.         tiempo = new Thread(crono);
  29.         crono.addObserver(this);
  30.         tiempo.start();
  31.  
  32.     }                                        
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement