Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQLException....

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what may cause to throw SQLException which says ResultSet has no more data? Could any one please let me know.
Thanks in advance,
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually this means that you are not checking the returned result of the ResultSet.next() method. It returns true if there are more elements in the ResultSet, or false if there are none. Most people use code something like:
 
Rajeev Ranjan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose you make a object of resultset
ResulSet rs
and you use the code
rs.next() to retrieve data from the database
if rs.next() returns false then it will throw an exception Resultset has no more data.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic