title: How to create IN OUT or OUT parameters in Java
body: <p>In PL/SQL (or many other languages), I can have IN OUT or OUT parameters, which are returned from a procedure. How can I achieve a similar thing in Java?</p>
  
  <p>I know this trick:</p>
  
  <pre><code>public void method(String in, String[] inOut, String[] inOut2) {
    inOut[0] = in;
  }
  </code></pre>
  
  <p>Where the <code>in</code> parameter represents an IN parameter and the <code>inOut</code> parameter can hold a return value. The convention would be that <code>String[] inOut</code> is an array of <code>inOut.length == 1</code>.</p>
  
  <p>That's kind of clumsy. </p>
  
  <p><strong>EDIT Feedback to answers</strong>: Other tricks include:</p>
  
  <ul>
  <li>holder/wrapper classes, but I don't want to introduce any new types, callbacks, etc.</li>
  <li>return values: I'd like a <strong>general</strong> solution. I.e. one with several IN OUT parameters involved.</li>
  <li>wrapper for IN OUT parameter as a return value: That's a viable option, but still not so nice, because that wrapper would have to be generated somehow</li>
  </ul>
  
  <p>Does anyone know a better way to achieve this generally? The reason I need a general solution is because I want to generate convenience source code from PL/SQL in a database schema.</p>