开发者

Check for unique row existence via jdbc

开发者 https://www.devze.com 2023-03-06 06:12 出处:网络
I\'m using resultSet.next() to check whether a unique row exist in the database or not. But it is returning false even when the row exists in the database.

I'm using resultSet.next() to check whether a unique row exist in the database or not. But it is returning false even when the row exists in the database.

Can anyone explain the first comment of the first answer of this page?.开发者_JS百科


If there is any row in the database which you are expecting, then first call to resultSet.next() should return true.

Answer on this page. If you are expecting only one row to be returned from database then first call to resultSet.next() will return true and any furter call will return false. First next() call on resultSet takes cursor to the first row.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号