wood burning stoves 2.0*
The moose likes JDBC and the fly likes Strange behaviour of ResultSet next method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Strange behaviour of ResultSet next method" Watch "Strange behaviour of ResultSet next method" New topic
Author

Strange behaviour of ResultSet next method

Adnan Gondal
Ranch Hand

Joined: Apr 30, 2011
Posts: 32
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

Joined: Aug 13, 2004
Posts: 1081

  • What does console print ? can you post the output
  • are you sure about case-sensitivity in your query userName ='ajay'



  • Thanks,
    Shailesh


    Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
    Adnan Gondal
    Ranch Hand

    Joined: Apr 30, 2011
    Posts: 32
    @salesh:ya i'm sure about case sensitivity and output is comeing on console.
    Shailesh Chandra
    Ranch Hand

    Joined: Aug 13, 2004
    Posts: 1081

    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

    Joined: Apr 30, 2011
    Posts: 32
    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
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Strange behaviour of ResultSet next method