Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrollable Resultset

Status
Not open for further replies.

WebGoat

MIS
Jul 16, 2005
85
US
Hi, i know Resultset when i read JDBC. Its basically a set of records . but what is Scrollable Resultset ? why it is called "Scrollable". what it means ? please explain in simple words. i want to learn.

thank you
 
A scollable resultset is one in which you can move back and forth over the resultset.

Say you are reading the resultset record by record, and then for some reason, want to go back to the beginning (the first record), then you can with a scrollable resultset.

Bear in mind not all JDBC drivers support scrollable resultsets.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Say you are reading the resultset record by record, and then for some reason, want to go back to the beginning (the first record), then you can with a scrollable resultset.

my god !. it is so powerfull! i understand now. because in in simple ResultSet once i use

while(rs.next())
{
// i have to always go forward , there is no way i can look back


}


but from your comment , i see a hope to go back to the visited records. great! excellent.

thanks . i will have a more look on it.

Bear in mind not all JDBC drivers support scrollable resultsets.

i trust SQL server driver from microsoft though i never tested for this.
 
Yes, the MS SQL Server driver supports scrollable result sets.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Does that have performance issues?

I''ve always thought that there must me a powerful reason to not make all ResultSets "scrollable".

Cheers,

Dian
 
Not neccesary if the scroll is limited, or if the number of rows is small. My main concern is about the way the driver retrieve the data when scrolling back the Resultset.

Does it have a cache or does it retruieve again the data from the database?

Cheers,

Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top