Efficient way to do batch INSERTS with JDBC

前端 未结 10 731
无人共我
无人共我 2020-11-22 14:12

In my app I need to do a lot of INSERTS. Its a Java app and I am using plain JDBC to execute the queries. The DB being Oracle. I have enabled batching though, so it saves me

10条回答
  •  爱一瞬间的悲伤
    2020-11-22 14:48

    Using PreparedStatements will be MUCH slower than Statements if you have low iterations. To gain a performance benefit from using a PrepareStatement over a statement, you need to be using it in a loop where iterations are at least 50 or higher.

提交回复
热议问题