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_VALUEit works, why is this? - If we set negative value then it gives illegal value error but
Integer.MIN_VALUEis-2147483648so why is it not giving errors? - This table contains 6 million records and I closed
resultsetafter 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.