title: passing data from Oracle stored procedures to Java
body: <p>We're going to write a new web interface for a big system based on Oracle database. All business rules are already coded in <code>PL/SQL</code> stored procedures and we'd like to reuse as much code as possible. We'll write some new stored procedures that will combine the existing business rules and return the final result dataset. </p>
  
  <p>We want to do this on the database level to avoid java-db round trips. The interface layer will be written in Java (we'd like to use GWT), so we need a way of passing data from Oracle stored procedures to Java service side. The data can be e.g. a set of properties of a specific item or a list of items fulfilling certain criteria. 
  Would anyone recommend a preferable way of doing this?</p>
  
  <p><strong>We're considering one of the 2 following scenarios:</strong></p>
  
  <blockquote>
    <ul>
    <li><p>passing objects and lists of objects (DB object types defined on the
    schema level)</p></li>
    <li><p>passing a <code>sys_refcursor</code></p></li>
    </ul>
  </blockquote>
  
  <p>We verified that both approaches are "doable", the question is more about design decision, best practice, possible maintenance problems, flexibility, etc.</p>
  
  <p>I'd appreciate any hints.</p>