If .equals
does not show them to be equal, then there is a difference. Could there be a space after one of them, or perhaps some other extra character?
Try printing both of them surrounded by a known character, maybe something like:
System.out.println("*" + resultset.getString("name") + "*");
Also, as a dummy check, make sure getString
is actually returning type String. If this is a method you've defined, it could be returning something strange.