title: MySQL and JDBC with rewriteBatchedStatements=true
body: <p>I've been reading around, <a href="http://java-persistence-performance.blogspot.ch/2013/05/batch-writing-and-dynamic-vs.html" rel="noreferrer">here</a>, <a href="http://anonymousbi.wordpress.com/2014/02/11/increase-mysql-output-to-80k-rowssecond-in-pentaho-data-integration/" rel="noreferrer">here</a> and <a href="http://blog.javabien.net/2014/05/14/mysql-and-jdbc-batch-inserts/" rel="noreferrer">here</a> about the advantages of using <code>rewriteBatchedStatements=true</code></p>
  
  <p>If I understood it right, with <code>rewriteBatchedStatements=true</code> the JDBC will <em>pack</em> as many queries as possible into a single network packet, lowering this way the network overhead. Am I right?</p>
  
  <p>Then it comes into my attention that the value defined in the MySQL server for the <code>max_allowed_packet</code> may cause problems with the queries (queries not being executed on the server).</p>
  
  <p>So my second question is, does JDBC knows the value assigned to <code>max_allowed_packet</code> and therefore make the packet smaller than the defined value for <code>max_allowed_packet</code> or that is something that the developer has to take in consideration?</p>
  
  <p>If I understood something wrong, please let me know as well.</p>