Amazon DynamoDB
入门指南 (API Version 2012-08-10)
AWS 服务或AWS文档中描述的功能,可能因地区/位置而异。点 击 Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

步骤 5:(可选) 删除表

删除 Movies 表:

  1. 复制以下程序到您的 Java 开发环境中。

    // Copyright 2012-2015, Inc. or its affiliates. All Rights Reserved. // Licensed under the Apache License, Version 2.0. package com.amazonaws.codesamples.gsg; import com.amazonaws.client.builder.AwsClientBuilder; import; import; import; import; public class MoviesDeleteTable { public static void main(String[] args) throws Exception { AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard() .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration("http://localhost:8000", "us-west-2")) .build(); DynamoDB dynamoDB = new DynamoDB(client); Table table = dynamoDB.getTable("Movies"); try { System.out.println("Attempting to delete table; please wait..."); table.delete(); table.waitForDelete(); System.out.print("Success."); } catch (Exception e) { System.err.println("Unable to delete table: "); System.err.println(e.getMessage()); } } }
  2. 编译并运行程序。