I am now confused on using spring batch updates using BatchPreparedStatementSetter & ParameterizedPreparedStatementSetter under jdbcTemplate.batchupdate.
I have gone through various blogs and even spring docs but unable to grasp the concept behind it.
In one of the blog (Spring JDBC performing batch update example) they say:
ParameterizedPreparedStatementSetter: Using this, JdbcTemplate can execute multiple batch based on the batch size passed in the batchUpdate method.
BatchPreparedStatementSetter : Using this, JdbcTemplate will run only execute single batch based on the batch size returned by implementation this interface.
I wanted to know if i want to INSERT data into SQL Server DB. what would be difference in using each statements behind the scene. would they be sending DB call with
MULTIPLE INSERT CALLS BUT PREPARING STATEMENT ONCE
INSERT INTO TABLE VALUES(1,2,3)
INSERT INTO TABLE VALUES(2,3,5)
or
SINGLE INSERT WITH MULTIPLE VALUES AND PREPARING STATEMENT ONCE"
INSERT INTO TABLE VALUES(1,2,3),(2,3,5)
BTW i am using below sqljdbc version
<dependency>
<groupId>microsoft</groupId>
<artifactId>sqljdbc</artifactId>
<version>4</version>
</dependency>
and Spring version: 4.2.3.RELEASE