• Post Reply Bookmark Topic Watch Topic
  • New Topic

HELP!!!!!!!!!!!

 
Thomas Harrington
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can not get this to work. I have a table in a databse where I have users and passwords. I want to check if the values in the table are the same. If they are the same, I want it to print "a"; if the values are not the same i want it to print "B". It always prints "B" regardless if the entries are the same or not.

String aUser;
String aPass;
users.connect();
ResultSet rs = users.viewUser();
while (rs.next () ){

aUser = rs.getString( "wname" );
aPass = rs.getString( "wpass" );
if( aUser == aPass ) out.println( "a" ); else{ out.println("B"); }

}
[ April 18, 2003: Message edited by: Thomas Harrington ]
 
Chris Baron
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thomas,
try
if( aUser.equals( aPass ) ) out.pri....
cb
 
Thomas Harrington
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!!! It works great.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!