@SdkInternalApi
    final UpdateDatabaseResult executeUpdateDatabase(UpdateDatabaseRequest updateDatabaseRequest) {

        ExecutionContext executionContext = createExecutionContext(updateDatabaseRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<UpdateDatabaseRequest> request = null;
        Response<UpdateDatabaseResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new UpdateDatabaseRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDatabaseRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
                request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
                request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
                request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
                request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Timestream Write");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDatabase");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

            } finally {
                awsRequestMetrics.endEvent(Field.RequestMarshallTime);
            }

            URI cachedEndpoint = null;
            if (endpointDiscoveryEnabled) {
                DescribeEndpointsRequest discoveryRequest = new DescribeEndpointsRequest();
                cachedEndpoint = cache.get(awsCredentialsProvider.getCredentials().getAWSAccessKeyId(), discoveryRequest, true, endpoint);
            }

            HttpResponseHandler<AmazonWebServiceResponse<UpdateDatabaseResult>> responseHandler = protocolFactory.createResponseHandler(
                    new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDatabaseResultJsonUnmarshaller());
            response = invoke(request, responseHandler, executionContext, cachedEndpoint, null);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Modifies the KMS key for an existing database. While updating the database, you must specify the database name
and the identifier of the new KMS key to be used (<code>KmsKeyId</code>). If there are any concurrent
<code>UpdateDatabase</code> requests, first writer wins.
</p>
<p>
See <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.update-db.html">code
sample</a> for details.
</p>

@param updateDatabaseRequest
@return Result of the UpdateDatabase operation returned by the service.
@throws ValidationException
        An invalid or malformed request.
@throws AccessDeniedException
        You are not authorized to perform this action.
@throws ResourceNotFoundException
        The operation tried to access a nonexistent resource. The resource might not be specified correctly, or
        its status might not be ACTIVE.
@throws ServiceQuotaExceededException
        The instance quota of resource exceeded for this account.
@throws ThrottlingException
        Too many requests were made by a user and they exceeded the service quotas. The request was throttled.
@throws InternalServerException
        Timestream was unable to fully process this request because of an internal server error.
@throws InvalidEndpointException
        The requested endpoint was not valid.
@sample AmazonTimestreamWrite.UpdateDatabase
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/timestream-write-2018-11-01/UpdateDatabase"
     target="_top">AWS API Documentation</a>
aws-java-sdk-timestreamwrite/src/main/java/com/amazonaws/services/timestreamwrite/AmazonTimestreamWriteClient.java