Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why Resultset's next is giving false

 
Huzefa Zohaib
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everything in my program is ok except rsa.next().
I am not getting that rsa.next() is giving false
although my HyperSonic database contains three colunms and two data entries.

while(rsa.next()) {
String nm= rsa.getString ("name");
out.println (nm);
}
Please guide me what could be the problem in your suggestions.
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what's your query order?
 
Kunal Aher
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please try running the query from the tool to test if the query really returns something !
Secondly , if possible try to use cachedrowsets , the reference implementation is available on the sun site. Advantage is that u get to know the size of the fetched results ( which is so desperately required sometimes )
Cheers
Kunal
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved from Servlets -> JDBC
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!