示例#1
0
  public void alteraJobAposExclusao(Connection conn, JobLote job) throws SQLException {

    ValoresAtualizaJob valores = retornaNovosValores(conn, job);

    PreparedStatement stmt = null;
    String update =
        "update job set qtd_transf = ?, hr_tot = ?, qtd_sucata = ?, status = ? where job = ? and operacao = ? ";

    stmt = conn.prepareStatement(update);
    stmt.setDouble(1, valores.getQtdTransf());
    stmt.setDouble(2, valores.getHoraTotal());
    stmt.setDouble(3, valores.getQtdSucata());
    stmt.setString(4, "R");
    stmt.setString(5, job.getJob().trim().replace(".", ""));
    stmt.setInt(6, job.getOperNum());
    stmt.executeUpdate();
  }
示例#2
0
  public void incluiIniciado(Connection conn, JobIniciado job) throws SQLException {

    String sql =
        "insert into jobsiniciados(job, operacao, data, tripulacao, ativo, recurso) values(?,?,?,?,?,?) ";
    PreparedStatement stmt = null;

    stmt = conn.prepareStatement(sql);
    stmt.setString(1, job.getJob().trim().replace(".", ""));
    stmt.setInt(2, job.getOperacao());
    stmt.setTimestamp(3, Validacoes.converteDataStringEmFormatoTimeStamp(job.getData().trim()));
    stmt.setDouble(4, job.getTripulacao());
    stmt.setBoolean(5, true);
    stmt.setString(6, job.getRecurso().trim());
    stmt.executeUpdate();
  }
示例#3
0
  public void alteraIniciado(Connection conn, JobIniciado job) throws SQLException {

    String sql =
        " update jobsiniciados set data = ?, ativo = ?, tripulacao = ?, recurso = ?  "
            + "    where job = ? and operacao = ? ";
    PreparedStatement stmt = null;

    stmt = conn.prepareStatement(sql);

    stmt.setTimestamp(1, Validacoes.converteDataStringEmFormatoTimeStamp(job.getData().trim()));
    stmt.setBoolean(2, true);
    stmt.setDouble(3, job.getTripulacao());
    stmt.setString(4, job.getRecurso().trim());
    stmt.setString(5, job.getJob().trim().replace(".", ""));
    stmt.setInt(6, job.getOperacao());
    stmt.executeUpdate();
  }