• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

End of recordset  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Marshal
Posts: 67197
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Winner
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I had no idea that next() could be used in that way. Thanks!
 
What a stench! Central nervous system shutting down. Save yourself tiny ad!
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!