title: Using AWS Aurora data api for java with AWS Sdk for Java 2.x
body: <p>I have been trying to use the Aurora aws data api from my lambda to do some operations like insert and update on the tables. The issue that I am facing is the official <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html#data-api.java-client-library" rel="nofollow noreferrer">doc</a> only provides the details about using AWS SDK for Java version 1.x. The latest version of the aws java sdk 2.x has several changes compared to version 1.0 which prevent me from porting the code over to the latest sdk. I was unable to find the updated documentation for data api for java aws sdk 2.0. It would be great if someone could provide me a sample code which performs the same operations as below on the latest sdk :</p>
  <pre><code>public void insert() {
      AWSRDSData rdsData = AWSRDSDataClient.builder().build();
  
      BatchExecuteStatementRequest request = new BatchExecuteStatementRequest()
              .withDatabase(&quot;test&quot;)
              .withResourceArn(RESOURCE_ARN)
              .withSecretArn(SECRET_ARN)
              .withSql(&quot;INSERT INTO test_table2 VALUES (:string, :number)&quot;)
              .withParameterSets(Arrays.asList(
                      Arrays.asList(
                              new SqlParameter().withName(&quot;string&quot;).withValue(new Field().withStringValue(&quot;Hello&quot;)),
                              new SqlParameter().withName(&quot;number&quot;).withValue(new Field().withLongValue(1L))
                      ),
                      Arrays.asList(
                              new SqlParameter().withName(&quot;string&quot;).withValue(new Field().withStringValue(&quot;World&quot;)),
                              new SqlParameter().withName(&quot;number&quot;).withValue(new Field().withLongValue(2L))
                      )
              ));
  
      rdsData.batchExecuteStatement(request);
  }
  </code></pre>