Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Whats wrong?

 
vinuharan haran
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get username and password in a form.I use a servlet to vaidate those parameters.
The strange thing is..
Even though the password entered and the one in database seem to be same( i verified this by printing out)....the code fails to match.
The following line always returns false.
(password is the one entered in the form and opassword is the one retrived from database.)
I use mysql database.What am i missing here?
Thanks,
vinu.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basic Java. The == operator is a test for identity, not equality. To compare string values, use the equals() method.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, please read this regarding your choice of subject text.
 
vinuharan haran
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oooooops...i totally got lost...
next time will post my doubts with good subjectline...sorry about that..
thanks for the reply.
vinu.
[ July 25, 2006: Message edited by: vinuharan haran ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic