ResultSet - Cursor : rs.next() Taking lot of time
java, jdbc, oracle
Solution
Indeed, by default JDBC use a fetch size of 10. Thus, if you don't set a greater value, you'll call database for next records exactly 150 times ..., no need to explain drawbacks of round-trips.
All you have to do is to test performance by setting `fetchSize` to.. 100 for instance :
statement.setFetchSize(100);
You can play with this number to improve performance according to your environnement.
Problem
I have a cursor returned from Database executes in 31ms (milliseconds) . But when I use this cursor having more than 1500 rows for fetching rows ``` ResultSet rs = (ResultSet)cstm.getObject(6); while(rs.next()){ system.out.println("..."); } ``` Just simple transversing through each row of cursor it's taking more than 40 seconds (40000 ms) What can be done?