Reputation: 5616
So a TYPE_SCROLL_INSENSITIVE result set allows me to scroll in both directions where as TYPE_FORWARD_ONLY only allows me to move forward.
Since TYPE_SCROLL_INSENSITIVE allows me to do what TYPE_FORWARD_ONLY allows, why do I need TYPE_FORWARD_ONLY at all? I assume that TYPE_FORWARD_ONLY might be better performance wise but I would like to know how?
Upvotes: 2
Views: 1911
Reputation: 109016
In my experience, most cases you will only need to read data in one direction. To be honest, I have never even had to use anything other than TYPE_FORWARD_ONLY
(except when testing JDBC driver implementations). I know it is sometimes used in interactive GUI applications, that provide editable table views, although I would still consider different designs even for those type of systems.
Reading a result set in one direction has a number of advantages:
The disadvantages:
In contrast, scrolling result sets have as advantage basically the disadvantages of forward only.
Disadvantages for scrollable result sets however are:
Note, this list is probably not complete.
Upvotes: 4