Interface RdsDataAsyncClient

All Superinterfaces:
AutoCloseable, AwsClient, SdkAutoCloseable, SdkClient

@Generated("software.amazon.awssdk:codegen") @ThreadSafe public interface RdsDataAsyncClient extends AwsClient
Service client for accessing AWS RDS DataService asynchronously. This can be created using the static builder() method.

Amazon RDS Data Service

Amazon RDS provides an HTTP endpoint to run SQL statements on an Amazon Aurora Serverless v1 DB cluster. To run these statements, you work with the Data Service API.

The Data Service API isn't supported on Amazon Aurora Serverless v2 DB clusters.

For more information about the Data Service API, see Using the Data API in the Amazon Aurora User Guide.

  • Field Details

  • Method Details

    • batchExecuteStatement

      default CompletableFuture<BatchExecuteStatementResponse> batchExecuteStatement(BatchExecuteStatementRequest batchExecuteStatementRequest)

      Runs a batch SQL statement over an array of data.

      You can run bulk update and insert operations for multiple records using a DML statement with different parameter sets. Bulk operations can provide a significant performance improvement over individual insert and update operations.

      If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically.

      There isn't a fixed upper limit on the number of parameter sets. However, the maximum size of the HTTP request submitted through the Data API is 4 MiB. If the request exceeds this limit, the Data API returns an error and doesn't process the request. This 4-MiB limit includes the size of the HTTP headers and the JSON notation in the request. Thus, the number of parameter sets that you can include depends on a combination of factors, such as the size of the SQL statement and the size of each parameter set.

      The response size limit is 1 MiB. If the call returns more than 1 MiB of response data, the call is terminated.

      Parameters:
      batchExecuteStatementRequest - The request parameters represent the input of a SQL statement over an array of data.
      Returns:
      A Java Future containing the result of the BatchExecuteStatement operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • BadRequestException There is an error in the call or in a SQL statement.
      • StatementTimeoutException The execution of the SQL statement timed out.
      • InternalServerErrorException An internal error occurred.
      • ForbiddenException There are insufficient privileges to make the call.
      • ServiceUnavailableErrorException The service specified by the resourceArn parameter is not available.
      • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
      • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
      • RdsDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • batchExecuteStatement

      default CompletableFuture<BatchExecuteStatementResponse> batchExecuteStatement(Consumer<BatchExecuteStatementRequest.Builder> batchExecuteStatementRequest)

      Runs a batch SQL statement over an array of data.

      You can run bulk update and insert operations for multiple records using a DML statement with different parameter sets. Bulk operations can provide a significant performance improvement over individual insert and update operations.

      If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically.

      There isn't a fixed upper limit on the number of parameter sets. However, the maximum size of the HTTP request submitted through the Data API is 4 MiB. If the request exceeds this limit, the Data API returns an error and doesn't process the request. This 4-MiB limit includes the size of the HTTP headers and the JSON notation in the request. Thus, the number of parameter sets that you can include depends on a combination of factors, such as the size of the SQL statement and the size of each parameter set.

      The response size limit is 1 MiB. If the call returns more than 1 MiB of response data, the call is terminated.


      This is a convenience which creates an instance of the BatchExecuteStatementRequest.Builder avoiding the need to create one manually via BatchExecuteStatementRequest.builder()

      Parameters:
      batchExecuteStatementRequest - A Consumer that will call methods on BatchExecuteStatementRequest.Builder to create a request. The request parameters represent the input of a SQL statement over an array of data.
      Returns:
      A Java Future containing the result of the BatchExecuteStatement operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • BadRequestException There is an error in the call or in a SQL statement.
      • StatementTimeoutException The execution of the SQL statement timed out.
      • InternalServerErrorException An internal error occurred.
      • ForbiddenException There are insufficient privileges to make the call.
      • ServiceUnavailableErrorException The service specified by the resourceArn parameter is not available.
      • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
      • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
      • RdsDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • beginTransaction

      default CompletableFuture<BeginTransactionResponse> beginTransaction(BeginTransactionRequest beginTransactionRequest)

      Starts a SQL transaction.

      A transaction can run for a maximum of 24 hours. A transaction is terminated and rolled back automatically after 24 hours.

      A transaction times out if no calls use its transaction ID in three minutes. If a transaction times out before it's committed, it's rolled back automatically.

      DDL statements inside a transaction cause an implicit commit. We recommend that you run each DDL statement in a separate ExecuteStatement call with continueAfterTimeout enabled.

      Parameters:
      beginTransactionRequest - The request parameters represent the input of a request to start a SQL transaction.
      Returns:
      A Java Future containing the result of the BeginTransaction operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • BadRequestException There is an error in the call or in a SQL statement.
      • StatementTimeoutException The execution of the SQL statement timed out.
      • InternalServerErrorException An internal error occurred.
      • ForbiddenException There are insufficient privileges to make the call.
      • ServiceUnavailableErrorException The service specified by the resourceArn parameter is not available.
      • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
      • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
      • RdsDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • beginTransaction

      default CompletableFuture<BeginTransactionResponse> beginTransaction(Consumer<BeginTransactionRequest.Builder> beginTransactionRequest)

      Starts a SQL transaction.

      A transaction can run for a maximum of 24 hours. A transaction is terminated and rolled back automatically after 24 hours.

      A transaction times out if no calls use its transaction ID in three minutes. If a transaction times out before it's committed, it's rolled back automatically.

      DDL statements inside a transaction cause an implicit commit. We recommend that you run each DDL statement in a separate ExecuteStatement call with continueAfterTimeout enabled.


      This is a convenience which creates an instance of the BeginTransactionRequest.Builder avoiding the need to create one manually via BeginTransactionRequest.builder()

      Parameters:
      beginTransactionRequest - A Consumer that will call methods on BeginTransactionRequest.Builder to create a request. The request parameters represent the input of a request to start a SQL transaction.
      Returns:
      A Java Future containing the result of the BeginTransaction operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • BadRequestException There is an error in the call or in a SQL statement.
      • StatementTimeoutException The execution of the SQL statement timed out.
      • InternalServerErrorException An internal error occurred.
      • ForbiddenException There are insufficient privileges to make the call.
      • ServiceUnavailableErrorException The service specified by the resourceArn parameter is not available.
      • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
      • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
      • RdsDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • commitTransaction

      default CompletableFuture<CommitTransactionResponse> commitTransaction(CommitTransactionRequest commitTransactionRequest)

      Ends a SQL transaction started with the BeginTransaction operation and commits the changes.

      Parameters:
      commitTransactionRequest - The request parameters represent the input of a commit transaction request.
      Returns:
      A Java Future containing the result of the CommitTransaction operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • BadRequestException There is an error in the call or in a SQL statement.
      • StatementTimeoutException The execution of the SQL statement timed out.
      • InternalServerErrorException An internal error occurred.
      • ForbiddenException There are insufficient privileges to make the call.
      • ServiceUnavailableErrorException The service specified by the resourceArn parameter is not available.
      • NotFoundException The resourceArn, secretArn, or transactionId value can't be found.
      • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
      • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
      • RdsDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • commitTransaction

      default CompletableFuture<CommitTransactionResponse> commitTransaction(Consumer<CommitTransactionRequest.Builder> commitTransactionRequest)

      Ends a SQL transaction started with the BeginTransaction operation and commits the changes.


      This is a convenience which creates an instance of the CommitTransactionRequest.Builder avoiding the need to create one manually via CommitTransactionRequest.builder()

      Parameters:
      commitTransactionRequest - A Consumer that will call methods on CommitTransactionRequest.Builder to create a request. The request parameters represent the input of a commit transaction request.
      Returns:
      A Java Future containing the result of the CommitTransaction operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • BadRequestException There is an error in the call or in a SQL statement.
      • StatementTimeoutException The execution of the SQL statement timed out.
      • InternalServerErrorException An internal error occurred.
      • ForbiddenException There are insufficient privileges to make the call.
      • ServiceUnavailableErrorException The service specified by the resourceArn parameter is not available.
      • NotFoundException The resourceArn, secretArn, or transactionId value can't be found.
      • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
      • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
      • RdsDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • executeSql

      @Deprecated default CompletableFuture<ExecuteSqlResponse> executeSql(ExecuteSqlRequest executeSqlRequest)
      Deprecated.
      The ExecuteSql API is deprecated, please use the ExecuteStatement API.

      Runs one or more SQL statements.

      This operation is deprecated. Use the BatchExecuteStatement or ExecuteStatement operation.

      Parameters:
      executeSqlRequest - The request parameters represent the input of a request to run one or more SQL statements.
      Returns:
      A Java Future containing the result of the ExecuteSql operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • BadRequestException There is an error in the call or in a SQL statement.
      • InternalServerErrorException An internal error occurred.
      • ForbiddenException There are insufficient privileges to make the call.
      • ServiceUnavailableErrorException The service specified by the resourceArn parameter is not available.
      • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
      • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
      • RdsDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • executeSql

      Deprecated.
      The ExecuteSql API is deprecated, please use the ExecuteStatement API.

      Runs one or more SQL statements.

      This operation is deprecated. Use the BatchExecuteStatement or ExecuteStatement operation.


      This is a convenience which creates an instance of the ExecuteSqlRequest.Builder avoiding the need to create one manually via ExecuteSqlRequest.builder()

      Parameters:
      executeSqlRequest - A Consumer that will call methods on ExecuteSqlRequest.Builder to create a request. The request parameters represent the input of a request to run one or more SQL statements.
      Returns:
      A Java Future containing the result of the ExecuteSql operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • BadRequestException There is an error in the call or in a SQL statement.
      • InternalServerErrorException An internal error occurred.
      • ForbiddenException There are insufficient privileges to make the call.
      • ServiceUnavailableErrorException The service specified by the resourceArn parameter is not available.
      • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
      • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
      • RdsDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • executeStatement

      default CompletableFuture<ExecuteStatementResponse> executeStatement(ExecuteStatementRequest executeStatementRequest)

      Runs a SQL statement against a database.

      If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically.

      If the binary response data from the database is more than 1 MB, the call is terminated.

      Parameters:
      executeStatementRequest - The request parameters represent the input of a request to run a SQL statement against a database.
      Returns:
      A Java Future containing the result of the ExecuteStatement operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • BadRequestException There is an error in the call or in a SQL statement.
      • StatementTimeoutException The execution of the SQL statement timed out.
      • InternalServerErrorException An internal error occurred.
      • ForbiddenException There are insufficient privileges to make the call.
      • ServiceUnavailableErrorException The service specified by the resourceArn parameter is not available.
      • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
      • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
      • RdsDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • executeStatement

      default CompletableFuture<ExecuteStatementResponse> executeStatement(Consumer<ExecuteStatementRequest.Builder> executeStatementRequest)

      Runs a SQL statement against a database.

      If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically.

      If the binary response data from the database is more than 1 MB, the call is terminated.


      This is a convenience which creates an instance of the ExecuteStatementRequest.Builder avoiding the need to create one manually via ExecuteStatementRequest.builder()

      Parameters:
      executeStatementRequest - A Consumer that will call methods on ExecuteStatementRequest.Builder to create a request. The request parameters represent the input of a request to run a SQL statement against a database.
      Returns:
      A Java Future containing the result of the ExecuteStatement operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • BadRequestException There is an error in the call or in a SQL statement.
      • StatementTimeoutException The execution of the SQL statement timed out.
      • InternalServerErrorException An internal error occurred.
      • ForbiddenException There are insufficient privileges to make the call.
      • ServiceUnavailableErrorException The service specified by the resourceArn parameter is not available.
      • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
      • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
      • RdsDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • rollbackTransaction

      default CompletableFuture<RollbackTransactionResponse> rollbackTransaction(RollbackTransactionRequest rollbackTransactionRequest)

      Performs a rollback of a transaction. Rolling back a transaction cancels its changes.

      Parameters:
      rollbackTransactionRequest - The request parameters represent the input of a request to perform a rollback of a transaction.
      Returns:
      A Java Future containing the result of the RollbackTransaction operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • BadRequestException There is an error in the call or in a SQL statement.
      • StatementTimeoutException The execution of the SQL statement timed out.
      • InternalServerErrorException An internal error occurred.
      • ForbiddenException There are insufficient privileges to make the call.
      • ServiceUnavailableErrorException The service specified by the resourceArn parameter is not available.
      • NotFoundException The resourceArn, secretArn, or transactionId value can't be found.
      • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
      • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
      • RdsDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • rollbackTransaction

      default CompletableFuture<RollbackTransactionResponse> rollbackTransaction(Consumer<RollbackTransactionRequest.Builder> rollbackTransactionRequest)

      Performs a rollback of a transaction. Rolling back a transaction cancels its changes.


      This is a convenience which creates an instance of the RollbackTransactionRequest.Builder avoiding the need to create one manually via RollbackTransactionRequest.builder()

      Parameters:
      rollbackTransactionRequest - A Consumer that will call methods on RollbackTransactionRequest.Builder to create a request. The request parameters represent the input of a request to perform a rollback of a transaction.
      Returns:
      A Java Future containing the result of the RollbackTransaction operation returned by the service.
      The CompletableFuture returned by this method can be completed exceptionally with the following exceptions.
      • AccessDeniedException You do not have sufficient access to perform this action.
      • BadRequestException There is an error in the call or in a SQL statement.
      • StatementTimeoutException The execution of the SQL statement timed out.
      • InternalServerErrorException An internal error occurred.
      • ForbiddenException There are insufficient privileges to make the call.
      • ServiceUnavailableErrorException The service specified by the resourceArn parameter is not available.
      • NotFoundException The resourceArn, secretArn, or transactionId value can't be found.
      • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
      • SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
      • RdsDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
      See Also:
    • serviceClientConfiguration

      default RdsDataServiceClientConfiguration serviceClientConfiguration()
      Description copied from interface: SdkClient
      The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration
      Specified by:
      serviceClientConfiguration in interface AwsClient
      Specified by:
      serviceClientConfiguration in interface SdkClient
      Returns:
      SdkServiceClientConfiguration
    • create

      static RdsDataAsyncClient create()
      Create a RdsDataAsyncClient with the region loaded from the DefaultAwsRegionProviderChain and credentials loaded from the DefaultCredentialsProvider.
    • builder

      static RdsDataAsyncClientBuilder builder()
      Create a builder that can be used to configure and create a RdsDataAsyncClient.