Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ResultSet  RSS feed

 
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?
 
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.
 
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.
 
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!