This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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!
 
Author and ninkuma
Marshal
Posts: 66799
168
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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!