This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ResultSet

 
Ekrem Altintas
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a resultset object.I want to know if record(s) exist or not.Do you know a method for it?
 
Michael Duffy
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ekrem Altintas:
I created a resultset object.I want to know if record(s) exist or not.Do you know a method for it?


yes, java.sql.ResultSet.next() method returns true if there's another record available, false if not.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its better to check the API Docs prior to post this kind of questions.
 
Adam Richards
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's another possible (and reusable) approach. Call the getRowCount() function below & see if the return value is greater than zero.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic