Java应用程序访问amazon simpledb域



我需要在java中创建一个应用程序,可以访问simpledb中的域。我已经创建了帐户并生成了访问密钥。SDB资源管理器、scratchpad和firefox的SDB工具不能正常工作。

您需要指定domain所属的正确的region and endpointAmazon SimpleDB支持8个区域端点。

链接如下:http://docs.aws.amazon.com/general/latest/gr/rande.html sdb_region

下面是示例代码:

AmazonSimpleDBConfig theConfig = new AmazonSimpleDBConfig();
theConfig.ServiceURL = myEndpoint;  //where myEndPoint is the region endpoint you are interested in
AmazonSimpleDBClient simpleDbClient= new AmazonSimpleDBClient(myKey, mySecretKey, theConfig);
String selectExpression = "select * from LogTable";
SelectRequest selectRequestAction = new SelectRequest();
selectRequestAction.SelectExpression = selectExpression;
selectRequestAction.NextToken = null;
SelectResponse selectResponse = simpleDbClient.Select(selectRequestAction);
SelectResult selectResult = selectResponse.SelectResult;
List<Item> itemList = selectResult.Item;

同样的事情适用于您的third party tool。如果您正在使用SDB Explorer,那么在成功登录后,您应该在左上角看到区域和端点的列表。您应该探索可以找到创建的domain的正确区域端点。

相关内容

  • 没有找到相关文章

最新更新