Example usage for com.amazonaws.services.dynamodbv2.document Table putItem

List of usage examples for com.amazonaws.services.dynamodbv2.document Table putItem

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.document Table putItem.

Prototype

@Override
    public PutItemOutcome putItem(PutItemSpec spec) 

Source Link

Usage

From source file:org.kmbmicro.chatwebsocket.DbString.java

public static void createItems(ChatData chatData) {

    Table table = dynamoDB.getTable(tableName);
    System.out.println(table.getTableName());
    try {//from   www .j ava 2s.  co m

        Item item = new Item().withPrimaryKey("TimeStamp", dateNow()).withString("user", chatData.getUser())
                .withString("chat", chatData.getChat());
        table.putItem(item);
    } catch (Exception e) {
        System.err.println("Create items failed.");
        System.err.println(e.getMessage());

    }
}