Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

problem with while loop when ResultSet.next() is called

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello sir/friends,

I am retrieving values from database using ResultSet.next() ... it already executed program in one system..now i am trying to combine all the modules in another system ..i have created the required database for the application and also compiled successfully...but when i click on submit button after entering the username and the password i am getting a blank page...the problem is it is not entering the while block...



I am using tomcat5.5 and java 1.5.. for reference i am providing the code also...please suggest me any solution.. this problem is with some servlet programs only.. other servlet programs done on the other systems are successfully executed...






thank you'
Shanthi Naidu
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
have you checked the table ,if there any records exist in that table or not. Just put System.out.println("Records Exist"+rs.next()); for checking purpose.

regards,
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Shanthi!

Do you have any data. Please Check your table and DB Connection! Print
rs.getString(1) and check!
 
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you said the same exact code is working on another system, this is environment related. Check your logs, do the tables exist, is the data in the table? I hope you get the idea.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic