title: call procedures with output parameter from java
body: <p>I have this procedure and i want to call it from Java</p>
  
  <pre><code>declare 
      output number; 
  begin 
      output := procedure_name(dateType =&gt; 'D', dateFrom =&gt; '20130825', dateTo =&gt; '20130830'); 
  end;
  </code></pre>
  
  <p>I have used StoredProcedure and i have set the parameters for dateType, dateFrom and dateTo but my question is how do I retrieve the output parameter</p>
  
  <p>This is what i have done so far:</p>
  
  <pre><code>StoredProcedureQuery storedProcedure = em.createStoredProcedureQuery("procedure_name");
  
      storedProcedure.registerStoredProcedureParameter("output",String.class , ParameterMode.OUT);
      storedProcedure.registerStoredProcedureParameter("dateType", String.class, ParameterMode.IN);
      storedProcedure.registerStoredProcedureParameter("dateFrom", String.class, ParameterMode.IN);
      storedProcedure.registerStoredProcedureParameter("dateTo", String.class, ParameterMode.IN);
  
  
      storedProcedure.setParameter("dateType", "YYYYMMDD");
      storedProcedure.setParameter("dateFrom", "20130825");
      storedProcedure.setParameter("dateTo", "20130830");
  
      storedProcedure.execute();
  </code></pre>