title: How to use JDBI to insert multiple rows with a single INSERT?
body: <p>I'm trying to figure out how to do multi-row insert statements with JDBI.</p>
  
  <p>Here is what I've got:</p>
  
  <pre class="lang-java prettyprint-override"><code>@SqlBatch("INSERT INTO my_table(col1, col2) VALUES (:col1, :col2)")
  @BatchSize(size=300)
  public abstract int[] insertRows(@BindBean MyObj ... objs);
  </code></pre>
  
  <p>... which works fine, but results in as many INSERT statements as there are rows being inserted. I.e. if there are two rows being inserted, it results in something like this:</p>
  
  <pre><code>INSERT INTO my_table(col1, col2) VALUES ('a', 'b');
  INSERT INTO my_table(col1, col2) VALUES ('c', 'd');
  </code></pre>
  
  <p>... when what I want looks like this:</p>
  
  <pre><code>INSERT INTO my_table(col1, col2) VALUES ('a', b'), ('c', 'd');
  </code></pre>
  
  <p>I'd like it to take a variable number of objects as input. I don't think JDBI can do this, at least not easily... But can it?</p>