title: Java JDBC clearBatch() and heap memory
body: <p>I've noticed the following behavior.</p>
  
  <p>I have a file that is about 3MB containing several thousand rows.
  In the rows I split and create prepared statement (about 250 000 statements).</p>
  
  <p>What I do is:</p>
  
  <pre><code>preparedStatement
  addBatch
  do for every 200 rows {
   executeBatch
   clearBatch().
  }
  </code></pre>
  
  <p>at the end</p>
  
  <pre><code>commit()
  </code></pre>
  
  <p>The memory usage will increase to around 70mb without out of memory error. Is it possible get the memory usage down? and have the transactional behavior (if one fails all fails.).
  I was able to lower the memory by doing commit with the <code>executeBatch</code> and <code>clearBatch</code>... but this will cause a partial insert of the total set.</p>