jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes End of recordset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "End of recordset" Watch "End of recordset" New topic

End of recordset

Michael Winner

Joined: Sep 15, 2003
Posts: 4
Please excuse my ignorance, I'm just a humble ASP programmer trying his best to learn JSP.
I'm setting up a database connection (no problem), looking to see if a record exists. If it exists, I need to collect the information, if it doesn't, I need to add a new record. Quite simple actually. In ASP, we would use a line like:
If recordSet.EOF Then
to determine if the recordset is already at the end. Is there something like this in JSP? I have no problem connecting and retrieving information, but I have no clue how to determine if the record exists, and how to add it, if it doesn't.
Thanks for any help!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63872

Hi Michael, welcome to the ranch!
This question has more to do with JDBC than with JSP per se, so I'm moving it along to that forum for you.
JSP Forum Bartender

[Asking smart questions] [About Bear] [Books by Bear]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Well, there is a method that you use to run through the record set:
This method moves the cursor in the ResultSet and returns a boolean of it's success.
So if you are searching for a specific record:

I am not sure if this is what you are talking about, so let me know if I am on the right track.

GenRocket - Experts at Building Test Data
Michael Winner

Joined: Sep 15, 2003
Posts: 4
Well, I had no idea that next() could be used in that way. Thanks!
I agree. Here's the link: http://aspose.com/file-tools
subject: End of recordset
It's not a secret anymore!