aspose file tools*
The moose likes JDBC and the fly likes Where is the cursor after we execute a query with statement ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Where is the cursor after we execute a query with statement ?" Watch "Where is the cursor after we execute a query with statement ?" New topic
Author

Where is the cursor after we execute a query with statement ?

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Hi
Thank you for reading my post.
imagine that you execute a query with stetement something like

where is cursor of rs now ?
is it in first , is yes does first means first record or it is before first record ?

Thank you
[ January 30, 2006: Message edited by: raminaa niilian ]
Thara Visu
Ranch Hand

Joined: May 17, 2005
Posts: 87
I believe its before the first record.
You need to traverse to the first record using rs.next() to get to the first record.


Thara<br />SCJP 1.4 96%<br />SCBCD 1.3 96%
chirs blr
Greenhorn

Joined: Jan 23, 2006
Posts: 1
its before the first record
ypu have to move it to first
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
... so the typical loop that precesses a result set looks like:

... rather than some freaky do/while loop to test at the loop's bottom!


There is no emoticon for what I am feeling!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where is the cursor after we execute a query with statement ?