During login I am fetching the password from the database for comparison with the user entered password, and if the comparison is successful, then I am storing that password into a variable using Setter method for further use in change password method.
In change Password method I need to compare the user entered value for old password with the current password stored in the database. So I am using the value stored in that variable using the getter method which was set during the successful login.
I just need to know whether these approach is correct or I need to call the database again for the password during?