JDBC - Oracle - BatchUpdateException.getUpdateCounts() returns blank array
<p>I am trying to execute the batch query using <code>PreparedStatement.executeBatch()</code> and trying to catch any exception occurred in <code>BatchUpdateException</code>. But I am getting a blank array on calling <code>BatchUpdateException.getUpdateCounts()</code>.</p>

<p>Below is my code:</p>

<pre><code>int[] updateCounts = null;  
PreparedStatement stmt = null;  
// some logic to set the stmt and create the SQL query
try {  
if (count % 100 == 0)   
    {  
        updateCounts = stmt.executeBatch();  
     }  
} catch (BatchUpdateException bu)  
{   
        updateCounts = bu.getUpdateCounts();  
}
</code></pre>

<p>Here I get an empty array of <code>updateCounts</code> when an exception occurs... Why?</p>

<p>NOTE:</p>

<p>BatchUpdateException - </p>

<blockquote>
  <p>SystemErr     R java.sql.BatchUpdateException: ORA-01400: cannot
  insert NULL into ("TABLE_ABC"."AMOUNT")</p>
</blockquote>

<p>CSV file from where the code reads the data... expecting error in the 3rd record</p>

<pre><code>Asof_Date,Price_Date,Amount
12/15/2015,11/26/2014,-2646.937686
12/15/2015,11/28/2014,5053.611471
12/15/2015,1/22/2015,
12/15/2015,1/23/2015,
</code></pre>