Tutorial about Using multi-threading in jdbc

前端 未结 7 866
别跟我提以往
别跟我提以往 2020-12-24 00:54

Our company has a Batch Application which runs every day, It does some database related jobs mostly, import data into database table from file for example.

There are

7条回答
  •  别那么骄傲
    2020-12-24 01:09

    Multi threading may be of help, if the lines are uncorrelated, you may start off two processes one reading even lines, another uneven lines, and get your db connection from a connection pool (dbcp) and analyze performance. But first I would investigate whether jdbc is the best approach normally databases have optimized solutions for imports like this. These solutions may also temporarily switch of constraint checking of your table, and turn that back on later, which is also great for performance. As always depending on your requirements.

    Also you may want to checkout springbatch which is designed for batch processing.

提交回复
热议问题