aspose file tools*
The moose likes JDBC 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 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "End of recordset" Watch "End of recordset" New topic
Author

End of recordset

Michael Winner
Greenhorn

Joined: Sep 15, 2003
Posts: 4
Hello!
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
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

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.
bear
JSP Forum Bartender


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

Joined: Jul 11, 2001
Posts: 15292
    
    6

Well, there is a method that you use to run through the record set:
next()
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
Greenhorn

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
 
Similar Threads
using gzip to compress results
Newbie needs help - use AJAX to open ASP?
Formatting Dates returned from SQL queries
Test to determine if field or method exists
Using a MIDlet to navigate a database recordset