我遇到的问题是.equals。我试图检查密码字符串是否等于数据库中密码的值。我的 serlvet 中有密码字符串,它从表单中获取密码。它检查用户名但不检查密码
public boolean acceptCustomer(String username, String password){
CustomerTableClass customer = new CustomerTableClass();
customer.setCustomerUsername(username);
customer.setCustomerPassword(password);
Boolean check = null;
try
{
entityManager = entityManagerFactory.createEntityManager();
CustomerTableClass customerTest = new CustomerTableClass();
customerTest = entityManager.find(customer.getClass(),username);
if (customerTest!=null)&&(password.equals(customer.getPassword()))){
check= true;
System.out.println("User found");
}