refactoring of user login java to sql
merged in fix, plus refactor of login