0

in my case i have, lets say 500k of select result. What i would like to do in JAVA code is to select this result partially, about 1k of result at once, without selectint whole list of results. Then use each 1k part of result to do batch insert.

The second step - batch insert is not a problem, but i dont know how to process partially result, avoiding select whole 500K result at once.

I prefer to use JdbcTemplate but if there is some other way to do that i would be grateful for any advice ;)

Thanks in advance

snowflake
  • 77
  • 1
  • 8

1 Answers1

0

You could paginate your sql query that you pass into the jdbctemplate to fetch just 1k entries everytime. There are multiple ways to paginate queries but the best way is usually dependent on which database you are using.

Oracle pagination resource Pagination in Oracle

Calvin Iyer
  • 161
  • 4