# selectUser() MilvusClient interface. This method gets all roles the user has. ```java R selectUser(SelectUserParam requestParam); ``` #### SelectUserParam Use the `SelectUserParam.Builder` to construct a `SelectUserParam` object. ```java import io.milvus.param.SelectUserParam; SelectUserParam.Builder builder = SelectUserParam.newBuilder(); ``` Methods of `SelectUserParam.Builder`:

Method

Description

Parameters

withUsername(String username)

Sets the username. Username cannot be empty or null.

username: The user name.

withIncludeRoleInfo(boolean includeRoleInfo)

Sets the includeRoleInfo. Default value is false.

includeRoleInfo: The include role info or not.

build()

Construct a SelectUserParam object.

N/A

The `SelectUserParam.Builder.build()` can throw the following exceptions: - ParamException: error if the parameter is invalid. #### Returns This method catches all the exceptions and returns an `R` object. - If the API fails on the server side, it returns the error code and message from the server. - If the API fails by RPC exception, it returns `R.Status.Unknown` and error message of the exception. - If the API succeeds, it returns a valid `SelectUserResponse` held by the `R` template. You can use `SelectUserResponse` to get the user information. #### Example ```java import io.milvus.param.SelectUserParam; R response = client.selectUser(SelectUserParam.newBuilder() .withUsername(userName) .build()); if (response.getStatus() != R.Status.Success.getCode()) { throw new RuntimeException(response.getMessage()); } ```