use of software.amazon.awssdk.services.dynamodb.DynamoDbClient in project aws-doc-sdk-examples by awsdocs.
the class EnhancedQueryRecordsWithSortKey method main.
public static void main(String[] args) {
Region region = Region.US_EAST_1;
DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
DynamoDbEnhancedClient enhancedClient = DynamoDbEnhancedClient.builder().dynamoDbClient(ddb).build();
queryTableSort(enhancedClient);
ddb.close();
}
use of software.amazon.awssdk.services.dynamodb.DynamoDbClient in project aws-doc-sdk-examples by awsdocs.
the class GetItem method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <tableName> <key> <keyVal>\n\n" + "Where:\n" + " tableName - the Amazon DynamoDB table from which an item is retrieved (for example, Music3). \n" + " key - the key used in the Amazon DynamoDB table (for example, Artist). \n" + " keyval - the key value that represents the item to get (for example, Famous Band).\n";
if (args.length != 3) {
System.out.println(USAGE);
System.exit(1);
}
String tableName = args[0];
String key = args[1];
String keyVal = args[2];
System.out.format("Retrieving item \"%s\" from \"%s\"\n", keyVal, tableName);
Region region = Region.US_WEST_2;
DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
getDynamoDBItem(ddb, tableName, key, keyVal);
ddb.close();
}
use of software.amazon.awssdk.services.dynamodb.DynamoDbClient in project aws-doc-sdk-examples by awsdocs.
the class DeleteItem method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <tableName> <key> <keyval>\n\n" + "Where:\n" + " tableName - the Amazon DynamoDB table to delete the item from (for example, Music3).\n" + " key - the key used in the Amazon DynamoDB table (for example, Artist). \n" + " keyval - the key value that represents the item to delete (for example, Famous Band).\n";
if (args.length != 3) {
System.out.println(USAGE);
System.exit(1);
}
String tableName = args[0];
String key = args[1];
String keyVal = args[2];
System.out.format("Deleting item \"%s\" from %s\n", keyVal, tableName);
Region region = Region.US_WEST_2;
DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
deleteDymamoDBItem(ddb, tableName, key, keyVal);
ddb.close();
}
use of software.amazon.awssdk.services.dynamodb.DynamoDbClient in project aws-doc-sdk-examples by awsdocs.
the class DescribeTable method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <tableName>\n\n" + "Where:\n" + " tableName - the Amazon DynamoDB table to get information about (for example, Music3).\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String tableName = args[0];
System.out.format("Getting description for %s\n\n", tableName);
Region region = Region.US_EAST_1;
DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
describeDymamoDBTable(ddb, tableName);
ddb.close();
}
use of software.amazon.awssdk.services.dynamodb.DynamoDbClient in project aws-doc-sdk-examples by awsdocs.
the class EnhancedBatchWriteItems method main.
public static void main(String[] args) {
Region region = Region.US_EAST_1;
DynamoDbClient ddb = DynamoDbClient.builder().region(region).build();
DynamoDbEnhancedClient enhancedClient = DynamoDbEnhancedClient.builder().dynamoDbClient(ddb).build();
putBatchRecords(enhancedClient);
ddb.close();
}
Aggregations