Creating a table using the AWS SDK for Java
Let's start with creating a table in DynamoDB using SDKs provided by Amazon.
Getting ready
To program various DynamoDB table operations, you can use the IDE of your choice, for example, Eclipse, NetBeans, Visual Studio, and so on. Here, we will be using the Eclipse IDE. In the previous chapter, we have already seen how to download and set up the Eclipse IDE.
How to do it…
Let's first see how to create a table in DynamoDB using the AWS SDK for Java.
You can create a Maven project and add the AWS SDK Maven
dependency. The latest version available can be found at http://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk/.
Here, I will be using Version 1.9.30, and its POM looks like this:
<dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk</artifactId> <version>1.9.30</version> </dependency>
Here are the steps to create a table using the AWS SDK for Java:
Create an instance of the
DynamoDB...