Java and DynamoDB
In this tutorial, you use the AWS SDK for Java to write simple programs to perform the following Amazon DynamoDB operations:
Create a table called
Moviesand load sample data in JSON format.
Perform create, read, update, and delete operations on the table.
Run simple queries.
The SDK for Java offers several programming models for different use cases. In this exercise, the Java code uses the document model that provides a level of abstraction that makes it easier for you to work with JSON documents.
You use the downloadable version of DynamoDB in this tutorial. In the Summary, we explain how to run the same code against the DynamoDB web service.
Before you begin this tutorial, do the following:
Download and run DynamoDB on your computer. For more information, see Download and Run DynamoDB.
Sign up for Amazon Web Services and create access keys. You need these credentials to use AWS SDKs. To create an AWS account, go to http://aws.amazon.com/, choose Create an AWS Account, and then follow the online instructions.
Setup the AWS SDK for Java. You need to set up the following:
Install a Java development environment. If you are using Eclipse IDE, install the AWS Toolkit for Eclipse.
Install the AWS SDK for Java.
Setup your AWS security credentials for use with the SDK for Java.
For instructions, see Getting Started in the AWS SDK for Java Developer Guide.
As you work through this tutorial, you can refer to the SDK for Java documentation in Javadoc format. The Javadocs are available at http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/.
We also recommend you review the DynamoDB concepts. For more information, see Introduction to DynamoDB Concepts.