Bulk insert in Java using prepared statements batch update

前端 未结 4 2166
[愿得一人]
[愿得一人] 2020-11-30 00:02

I am trying to fill a resultSet in Java with about 50,000 rows of 10 columns and then inserting them into another table using the batchExecute method of P

4条回答
  •  遥遥无期
    2020-11-30 00:39

    If it's just data from one/more tables in the DB to be inserted into this table and no intervention (alterations to the resultset), then call statement.executeUpdate(SQL) to perform INSERT-SELECT statment, this is quicker since there is no overhead. No data going outside of the DB and the entire operation is on the DB not in the application.

提交回复
热议问题