Amazon DynamoDB
Developer Guide (API Version 2012-08-10)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Running Java Examples for DynamoDB

General Process of Creating Java Code Examples (Using Eclipse)


Download and install the AWS Toolkit for Eclipse. This toolkit includes the AWS SDK for Java, along with preconfigured templates for building applications.


Create a new AWS Java project in Eclipse.

Note that the project is pre-configured; it includes the AWS SDK for Java jar files, and also the file for your AWS access keys.


In the Create an AWS Java Project dialog box, enter project name in the Project name field and select one of the toolkit accounts from the Select Account drop-down list. To add a new account to the toolkit, click Configure AWS accounts....

Eclipse adds the AWS access keys associated with the toolkit account that you select to the file as shown in the following example:

#Insert your AWS Access Keys
#Wed Jan 04 19:02:08 PST 2012
secretKey=*** Your Account Secret Access Key***
accessKey=***Your Account Access Key ID***


Copy the code from the section that you are reading to your project.


Run the code.

Setting the Region

You can set the DynamoDB region explicitly, as shown in the following Java code snippet.

client = new AmazonDynamoDBClient(credentials);

For a current list of supported regions and endpoints, see Regions and Endpoints.