How to pass Table-Valued parameters from java to sql server stored procedure?
<p>I have a <code>Student</code> class with the following attributes:</p>

<pre><code>Name, Department, Address, Grade. 
</code></pre>

<p>Now I have an <code>ArrayList</code> that contains some <code>Student</code> objects like this,</p>

<pre><code>List&lt;Student&gt; stuList = new ArrayList&lt;Student&gt;();
stuList.add(new Student("Tom","Comp", "123 street", "A"));
stuList.add(new Student("Jery","Comp", "456 street", "A+"));
stuList.add(new Student("Mac","Maths", "Dum Street", "B"));
</code></pre>

<p>I need to pass this arraylist to the sql server stored procedure and insert the student object data into the table.
How to best achieve this in Java? I am required to have a stored procedure.</p>

<p>Java version 8, Sql Server 2014 if its of any use.</p>