Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strange behaviour of ResultSet next method

 
Adnan Gondal
Ranch Hand
Posts: 35
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
In the following code rs.next() is returning false even when the row exist in the database.
The sql query returning row in command line but returning false in code given below.
Kindly tell me that where i am making mistake.

 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • What does console print ? can you post the output
  • are you sure about case-sensitivity in your query userName ='ajay'



  • Thanks,
    Shailesh
     
    Adnan Gondal
    Ranch Hand
    Posts: 35
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    @salesh:ya i'm sure about case sensitivity and output is comeing on console.
     
    Shailesh Chandra
    Ranch Hand
    Posts: 1082
    Java Oracle Spring
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    only thing now I can think of is , if you are connected to correct database...just a guess that registered user table exists in both database !
     
    Adnan Gondal
    Ranch Hand
    Posts: 35
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Commit was not done in the database due to which queries were showing result in console but in jdbc code resultSet.next() was returning false.Thanks v v v much to all of you
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic