Spring security implementation with DB.