Data.Cloud.AmazonAPI.TAmazonTableService
Delphi
TAmazonTableService = class(TAmazonBasicService)
C++
class PASCALIMPLEMENTATION TAmazonTableService : public TAmazonBasicService
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | Data.Cloud.AmazonAPI.pas Data.Cloud.AmazonAPI.hpp |
Data.Cloud.AmazonAPI | Data.Cloud.AmazonAPI |
Description
Allows you to connect to the Amazon SimpleDB service.
This class provides methods that you can use to:
- Create or delete a table.
- List existing tables.
- Get the metadata associated with a table.
- Insert a row or multiple rows into a table.
- Delete a row from a table.
- Retrieve rows or just the row names (IDs) from a table.
- Delete specific columns or all the columns from a row.
Additionally, TAmazonTableService provides some methods that return the response in an XML-parsed format:
For more information about the Amazon SimpleDB API, see the official Amazon SimpleDB Documentation.
- Note: The official Amazon documentation refers to
Tables
asDomains
,Rows
asItems
andColumns
asAttributes
.
The following code snippet demonstrates how to create a new table using the TAmazonTableService API:
Delphi:
var
ResponseInfo: TCloudResponseInfo;
TableService: TAmazonTableService;
TableName:String;
begin
TableName := 'TableName';
TableService := TAmazonTableService.Create(AmazonConnectionInfo1);
ResponseInfo := TCloudResponseInfo.Create;
try
if TableService.CreateTable(TableName, ResponseInfo) then
Memo1.Lines.Append('Success! Table: ' + TableName + ' created.')
else
Memo1.Lines.Append(Format('Failure! %s', [ResponseInfo.StatusMessage]));
finally
TableService.Free;
ResponseInfo.Free;
end;
end;
C++:
TCloudResponseInfo *ResponseInfo;
String TableName;
TAmazonTableService *TableService;
TableName = "TableName";
TableService = new TAmazonTableService(AmazonConnectionInfo1);
ResponseInfo = new TCloudResponseInfo;
try
{
if (TableService->CreateTable(TableName, ResponseInfo))
{
Memo1->Lines->Append("Success! Table: " + TableName + " created.");
}
else
{
TVarRec args[1] = {ResponseInfo->StatusMessage};
Memo1->Lines->Append(Format("Failure! %s", args, 0));
}
}
__finally
{
delete TableService;
delete ResponseInfo;
}