title: Get number of rows updated with PreparedStatement
body: <p>How to get how many rows updated with PreparedStatement?</p>
  
  <p><code>.getUpdateCount()</code> returns 0.</p>
  
  <p>For <code>executeUpdate</code> got error:<br/>
  <strong><em>error occurred during batching: batch must be either executed or cleared</em></strong></p>
  
  <p>my code:</p>
  
  <pre><code>updTrans = dataSource.getConnection().prepareStatement("update...");
  updTrans.setInt(1, Integer.valueOf(transaksjonstatusid));
  ...
  updTrans.addBatch();
  upd = updTrans.executeUpdate();
  </code></pre>