Initially, I asked this question
I solve this by setting fetchSize
to Integer.MIN_VALUE
, but I have some questions about this
- When I set fetchSize to 10 or another positive integer then it does not work, after setting it to
Integer.MIN_VALUE
it works, why is this? - If we set negative value then it gives illegal value error but
Integer.MIN_VALUE
is-2147483648
so why is it not giving errors? - This table contains 6 million records and I closed
resultset
after fetching 100 or 200 records then it takes 30-35 seconds of time. - Solution to decrease time to close that
resultset
.
I want to add something more here
I have tested this with MySQL driver and it accept Integer.MIN_VALUE
but when I test same code in SQL server then it gives error The fetch size cannot be negative.
and if I set it to 10 then it works, it also works for Oracle.