implement dbaccess and login

DB part need improvement