title: JDBC: ORCLE stored procedures with return-value in batch-processing
body: <p>I have a JDBC connect to a Oracle RDBMS. </p>
  
  <p>I need to call a stored procedure (lets name it foo) that returns a number.</p>
  
  <p>It is working fine if I perform every statement for its own.</p>
  
  <pre><code>for (int i = 0; i &lt; 10;i ++)
  {
    CallableStatement cst = con.prepareCall ("{? = foo (" + i + ")}");
    cst.registerOutParameter (1, Types.INTEGER);
    cst.execute ();
  }
  </code></pre>
  
  <p>NOW I like to use batched processing to boost it up the performance. Thats my approach.</p>
  
  <pre><code>Statement st = con.createStatement ();
  for (int i = 0; i &lt; 10;i ++)
  {
    st.addBatch ("{? = foo (" + i + ")}");
  }
  st.executeBatch ();
  </code></pre>
  
  <p>That does not work.</p>
  
  <p>Error tells me not every variable is assigned. Think it is because there is no registration for the return-value as it is in the working sample above.</p>
  
  <p>If I set the statement to </p>
  
  <pre><code>{foo (" + i + ")}
  </code></pre>
  
  <p>to remove the return then I get the error that the procedure is not defined.</p>
  
  <p>How can I handle such a stored procedure with a return-value in batched processing?</p>