title: Inserting data into PostgreSQL table from MATLAB with JDBC throws BatchUpdateException
body: <p>I am trying to write to a PostgreSQL database table from MATLAB. I have got the connection working using JDBC and created the table, but I am getting a BatchUpdateException when I try to insert a record.</p>
  
  <p>The MATLAB query to insert the data is:</p>
  
  <pre><code>user_table = 'rm_user';
  colNames = {user_id};
  data = {longRecords(iterator)};
  fastinsert(conn, user_table, colNames, data);
  </code></pre>
  
  <p>The exception says:</p>
  
  <pre><code>java.sql.BatchUpdateException: Batch entry 0 INSERT INTO rm_user (user_id) VALUES ( '4') was aborted.  Call getNextException to see the cause.
  </code></pre>
  
  <p>But I don't know how to call <code>getNextException</code> from MATLAB.</p>
  
  <p>Any ideas what's causing the problem or how I can find out more about the exception?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Turns out I was looking at documentation for a newer version of MATLAB than mine. I have changed from <code>fastinsert</code> to <code>insert</code> and it is now working. However, I'm still interested in knowing if there is a way I could use <code>getNextException</code> from MATLAB.</p>