| Author |
unexpected output
|
Amritpal Singh Moomie
Ranch Hand
Joined: Sep 24, 2010
Posts: 32
|
|
HI I am trying to create a user check method by accessing database for my jsf application.
Can anybody tell me why i am getting login (i.e success output ) from code even when i enter wrong loginname and password?
|
 |
Amritpal Singh Moomie
Ranch Hand
Joined: Sep 24, 2010
Posts: 32
|
|
I am trying to check whether the resultset is null or not?
If its null that is there is no record like that means fail (no login)
and if its not null that is success( successfull login)
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
ResultSets are never null. They are empty sometimes though...
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Amritpal Singh Moomie
Ranch Hand
Joined: Sep 24, 2010
Posts: 32
|
|
so how can i check that there is no record for that query?
or it is empty
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
Have a look at the ResultSet JavaDocs. You should see the method available to you. Alternatively you could change your sql to count the number of users that match your search criteria and check that.
|
 |
Amritpal Singh Moomie
Ranch Hand
Joined: Sep 24, 2010
Posts: 32
|
|
thanks for the help
I figured out how to do it
|
 |
 |
|
|
subject: unexpected output
|
|
|