@Override
    public ChatRoomSession login(String username, String password)
            throws ChatRoomLoginException, RemoteException {
        
        if(users.containsKey(username)) {
            if(!users.get(username).equals(password)) {
                throw new ChatRoomLoginException();
            }
        } else {
            try {
                dbConnector.addUser(username, password);
                users.put(username, password);
            } catch(SQLException e) {
                throw new ChatRoomLoginException();
            }
        }
        
        ChatRoomSessionImp session = new ChatRoomSessionImp(username, this);
        ChatRoomSession stub = (ChatRoomSession) UnicastRemoteObject.exportObject(session, 0);
                
        return stub;        
    }