Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes getting first element of Resultset Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "getting first element of Resultset" Watch "getting first element of Resultset" New topic
Author

getting first element of Resultset

vivek, tiwari
Greenhorn

Joined: Apr 13, 2001
Posts: 3
hi guys..
i created a resultset rs
How can i get the first element of rs and does it support any command like rs.moveNext() or rs.moveLast()...
Kindly help.....
n thanks for taking a look at this...
Naveed Azhar
Greenhorn

Joined: Apr 15, 2001
Posts: 5
Hi vivek, tiwari:
Doesn't rs.next() help you??

------------------
Muhammad Naveed Azhar
(naveed@hotmail.com)


Muhammad Naveed Azhar<BR>(naveed@hotmail.com)
ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
if ( rs.next() )
{
you are at the first row of resultset
}

SCJP, SCJD, SCWCD, SCBCD, SCEA
dharmeshc
Greenhorn

Joined: Apr 16, 2001
Posts: 8
depends whether you are using JDBC which supports a scrollable resultset!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: getting first element of Resultset
 
Similar Threads
Populate the data into an ArrayList
Processing of Multiple Resultset
ResultSet
handle empty recordset
resultset