sqlQuery.executeUpdate();只能执行完存储过程,不知道该怎么拿 @nextno
public ProcedureResult submitApplication(Long stageId) {
StoredProcedureQuery query = em.createStoredProcedureQuery("qu_utl_java.submit_application");
query.registerStoredProcedureParameter("p_ase_id", Long.class, ParameterMode.IN);
query.registerStoredProcedureParameter("p_id", String.class, ParameterMode.OUT);
query.registerStoredProcedureParameter("p_result", String.class, ParameterMode.OUT);
query.registerStoredProcedureParameter("p_error_message", String.class, ParameterMode.OUT);
query.registerStoredProcedureParameter("p_bypass_communication", String.class, ParameterMode.IN);
query.setParameter("p_ase_id", stageId);
query.setParameter("p_bypass_communication", "N");
query.execute();
ProcedureResult result = new ProcedureResult();
result.setExecutionResult((String) query.getOutputParameterValue("p_result"));
result.setResultID((String) query.getOutputParameterValue("p_id"));
result.setErrorMessage((String) query.getOutputParameterValue("p_error_message"));
return result;
}
給你參考