Announcement Announcement Module
Collapse
No announcement yet.
getSimpleJdbcTemplate().batchUpdate() Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • getSimpleJdbcTemplate().batchUpdate()

    I have java.util.List of sql query and java.util.List of Object[] parameters

    How i should persist using getSimpleJdbcTemplate().batchUpdate(sql, parameters) ?

    I mean to say the sql query and the parameters are dynamic and finally i have two java.util.List sqlList and parametersList
    Last edited by springbeginners; Dec 8th, 2009, 06:35 AM.

  • #2
    spring batch is not the same as jdbc batch

    check Hibernate forum instead

    Comment


    • #3
      I am not using the Hibernate, any other alternate solution is available in spring ?

      Comment


      • #4
        http://forum.springsource.org/forumdisplay.php?f=27

        Comment


        • #5
          Batch update

          The getSimpleJdbcTemplate().batchUpdate(String sql, Object[] arguments) is inteded to execute the same query multiple times with different arguments.

          It's not possible to execute different queries with batchUpdate.

          Use getSimpleJdbcTemplate().update (..) in an iteration and make sure you do this in the same transaction.

          In my opinion it's questionable using a list of queries with a corresponding list of arguments is the rigth way to implement your business logic.
          Last edited by BramB75; Dec 10th, 2009, 04:59 AM.

          Comment

          Working...
          X