Search in sources :

Example 1 with DeleteTableRequest

use of software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest in project aws-doc-sdk-examples by awsdocs.

the class DeleteTable method deleteDynamoDBTable.

// snippet-start:[dynamodb.java2.delete_table.main]
public static void deleteDynamoDBTable(DynamoDbClient ddb, String tableName) {
    DeleteTableRequest request = DeleteTableRequest.builder().tableName(tableName).build();
    try {
        ddb.deleteTable(request);
    } catch (DynamoDbException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
    System.out.println(tableName + " was successfully deleted!");
}
Also used : DeleteTableRequest(software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest) DynamoDbException(software.amazon.awssdk.services.dynamodb.model.DynamoDbException)

Example 2 with DeleteTableRequest

use of software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest in project aws-doc-sdk-examples by awsdocs.

the class Scenario method deleteDynamoDBTable.

public static void deleteDynamoDBTable(DynamoDbClient ddb, String tableName) {
    DeleteTableRequest request = DeleteTableRequest.builder().tableName(tableName).build();
    try {
        ddb.deleteTable(request);
    } catch (DynamoDbException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
    System.out.println(tableName + " was successfully deleted!");
}
Also used : DeleteTableRequest(software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest) DynamoDbException(software.amazon.awssdk.services.dynamodb.model.DynamoDbException)

Aggregations

DeleteTableRequest (software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest)2 DynamoDbException (software.amazon.awssdk.services.dynamodb.model.DynamoDbException)2