例:
StoredProcedureQuery storedProcedure = em.createStoredProcedureQuery("sales_tax");// set parametersstoredProcedure.registerStoredProcedureParameter("subtotal", Double.class, ParameterMode.IN);storedProcedure.registerStoredProcedureParameter("tax", Double.class, ParameterMode.OUT);storedProcedure.setParameter("subtotal", 1f);// execute SPstoredProcedure.execute();// get resultDouble tax = (Double)storedProcedure.getOutputParameterValue("tax");
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)