title: set batch size in spring JDBC batch update
body: <p>How do I set batch size in spring JDBC batch update to improve performance?
  Listed below is my code snippet.</p>
  
  <pre class="lang-java prettyprint-override"><code>public void insertListOfPojos(final List&lt;Student&gt; myPojoList) {
  
      String sql = "INSERT INTO " + "Student " + "(age,name) " + "VALUES "
              + "(?,?)";
      try {
          jdbcTemplateObject.batchUpdate(sql,
                  new BatchPreparedStatementSetter() {
  
                      @Override
                      public void setValues(PreparedStatement ps, int i)
                              throws SQLException {
  
                          Student myPojo = myPojoList.get(i);
                          ps.setString(2, myPojo.getName());
                          ps.setInt(1, myPojo.getAge());
  
                      }
  
                      @Override
                      public int getBatchSize() {
                          return myPojoList.size();
                      }
                  });
      } catch (Exception e) {
          System.out.println("Exception");
      }
  }
  </code></pre>
  
  <p>I read that with Hibernate you can provide your batch size in the
  configuration xml.
  For example,
  <code>&lt;property name="hibernate.jdbc.batch_size" value="100"/&gt;</code>.
  Is there something similar in Spring's jdbc?</p>