can someone please tell me difference between JDBC ResultSet Scroll Sensitive Type and Result Set Scroll Insensitive Type?
Where we use these usually in projects?
In TYPE_SCROLL_INSENSITIVE cursor can move (scroll) both forward and backward. In TYPE_SCROLL_SENSITIVE cursor can move (scroll) both forward and backward.
Result Set Scroll Insensitive Type ( TYPE_SCROLL_INSENSITIVE ) : specifies that a resultset is scrollable in either direction but is insensitive to changes committed by other transactions or other statements in the same transaction.
JDBC provides two types of result sets that allow you to scroll in either direction or to move the cursor to a particular row. Derby supports one of these types: scrollable insensitive result sets ( ResultSet. TYPE_SCROLL_INSENSITIVE ). When you use a result set of type of type ResultSet.
The type of a ResultSet object determines the level of its functionality in two areas: the ways in which the cursor can be manipulated, and how concurrent changes made to the underlying data source are reflected by the ResultSet object.
TYPE_SCROLL_INSENSITIVE:
The result can be scrolled; its cursor can move both forward and backward relative to the current position, and it can move to an absolute position. The result set is insensitive to changes made to the underlying data source while it is open. It contains the rows that satisfy the query at either the time the query is executed or as the rows are retrieved.
TYPE_SCROLL_SENSITIVE:
The result can be scrolled; its cursor can move both forward and backward relative to the current position, and it can move to an absolute position. The result set reflects changes made to the underlying data source while the result set remains open.
Refer javase tutorial for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With