How to convert Java List into an Oracle ARRAY to enter as a param in an Oracle Stored procedure?
<p>I have the following <code>list</code> of Person Objects:</p>

<pre><code>List&lt;Person&gt; persons;
</code></pre>

<p>The Person object is as follows:</p>

<pre><code>@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class Person
{
    @XmlElement
    private int id;
    @XmlElement
    private String name;

    public Person(){

    }

}
</code></pre>

<p>A <code>Stored Procedure</code> I am invoking takes a list of Person Objects as an <code>Oracle ARRAY</code>. </p>

<p>How can I convert my list of Java Objects into an Oracle ARRAY in order to pass it into the Stored Procedure?</p>

<p>I have seen the <code>CallableStatement.setArray()</code> method, but I do not know how to convert my Java List into an Oracle ARRAY first. </p>