private void jBtnBorrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnBorrarActionPerformed
        // TODO add your handling code here:
        try {
            jTextField1.setText("Buscar por Cliente");
            String sql = "DELETE FROM pedidos WHERE idpedidos = ? ";
            String sql1 = "UPDATE productos "
                    + "SET cantidad = cantidad + ? "
                    + "WHERE idproductos = ? ";
            Connection conn = Conexion.GetConnection();
            conn.setAutoCommit(false);
            PreparedStatement ps = conn.prepareStatement(sql);
            PreparedStatement ps1 = conn.prepareStatement(sql1);

            int rows = jTablePedHas.getRowCount();

            for (int j = 0; j < rows; j++) {
                ps1.setString(1, (String) jTablePedHas.getValueAt(j, 3));
                ps1.setString(2, (String) jTablePedHas.getValueAt(j, 0));

                ps1.executeUpdate();
                conn.commit();
            }

            ps.setString(1, (String) jTablePedidos.getValueAt(jTablePedidos.getSelectedRow(), 0));
            ps.execute();
            conn.commit();
            clearPedidos();
            clearPedHas();
            cargarPedidos();

        } catch (SQLException e) {
            System.out.println(e.getMessage());
        }
    }//GEN-LAST:event_jBtnBorrarActionPerformed