why spring jdbcTemplate batchUpdate insert row by row

前端 未结 2 1853
我在风中等你
我在风中等你 2020-12-30 11:20

I have 200K rows to be inserted in one single database table. I tried to use jdbcTemplate.batchUpdate in spring in order to do insertion 10,000 per batch. Howev

2条回答
  •  孤独总比滥情好
    2020-12-30 12:07

    Try setting below for connection string - useServerPrepStmts=false&rewriteBatchedStatements=true. Have not tried but its from my bookmarks. You can search on these lines..

    Connection c = DriverManager.getConnection("jdbc:://host:/db?useServerPrepStmts=false&rewriteBatchedStatements=true", "username", "password");
    

提交回复
热议问题