Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JDBC ResultSet Scroll Sensitive Type and Result Set Scroll Insensitive Type

Tags:

java

jdbc

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?

like image 885
Java P Avatar asked Aug 03 '12 12:08

Java P


People also ask

What is the difference between type scroll insensitive and type scroll sensitive?

In TYPE_SCROLL_INSENSITIVE cursor can move (scroll) both forward and backward. In TYPE_SCROLL_SENSITIVE cursor can move (scroll) both forward and backward.

What is the meaning of ResultSet type scroll insensitive?

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.

What are the ResultSet scroll types?

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.


1 Answers

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.

like image 108
Sandeep Pathak Avatar answered Oct 17 '22 01:10

Sandeep Pathak