PreparedStatement.addBatch in java has any restrictions?

后端 未结 1 501
旧巷少年郎
旧巷少年郎 2020-12-31 22:03

I\'m trying to optimize the process of inserting a large number of results to a remote mySQL database. I\'m using simple jdbc for that.

Currently I\'m replacing exi

相关标签:
1条回答
  • 2020-12-31 22:39

    @BalusC hit the nail on the head. If you're using MySQL, use the latest driver add rewriteBatchedStatements=true to your connection string to make statement.addBatch() actually create batch inserts.

    Nice presentation on MySQL JDBC performance: http://assets.en.oreilly.com/1/event/21/Connector_J%20Performance%20Gems%20Presentation.pdf

    0 讨论(0)
提交回复
热议问题