To complete the following sections, you must make configuration changes to the sample files.
To prepare the sample files
Extract the Amazon SimpleDB sample code into a directory on your machine designated as <sdb home>.
Configure your CLASSPATH environment variable to point to the Amazon SimpleDB Samples JAR archive and the included third party JARs. The following is an example in Linux.
export CLASSPATH=$CLASSPATH:\
<sdb home>/amazon-simpledb-2007-11-07-java-library\
/src/com/amazonaws/sdb/samples/\
<sdb home>/lib/amazon-simpledb-2007-11-07-java-library.jar:\
<sdb home>/third-party/jakarta-commons/commons-codec-1.3.jar:\
<sdb home>/third-party/jakarta-commons/commons-httpclient-3.0.1.jar:\
<sdb home>/third-party/jakarta-commons/commons-logging-1.1.jar:\
<sdb home>/third-party/jaxb-ri-2.1/activation.jar:\
<sdb home>/third-party/jaxb-ri-2.1/jaxb-all-deps.jar:\
<sdb home>/third-party/jaxb-ri-2.1/jaxb-api.jar:\
<sdb home>/third-party/jaxb-ri-2.1/jaxb-impl.jar:\
<sdb home>/third-party/jaxb-ri-2.1/jaxb-xjc.jar:\
<sdb home>/third-party/jaxb-ri-2.1/jsr173_1.0_api.jar:\
<sdb home>/third-party/log4j/log4j-1.2.14.jar
The following command changes your working directory.
<sdb home>/amazon-simpledb-2007-11-07-java-library/src/com/amazonaws/sdb/samples/
Open src/com/amazonaws/sdb/samples/CreateDomainSample.java.
Determine whether you will run the code against the mock service or your Amazon SimpleDB account:
To run the code against the mock service, comment out the following lines:
String accessKeyId = "<Your Access Key ID>"; String secretAccessKey = "<Your Secret Access Key>" AmazonSimpleDB service = new AmazonSimpleDBClient(accessKeyId, secretAccessKey)
Then, remove comment marks from the following line:
AmazonSimpleDB service = new AmazonSimpleDBMock();
To run the code against Amazon SimpleDB, make sure the following lines are not commented out and enter your Access Key ID and Secret Access Key:
String accessKeyId = "<Your Access Key ID>"; String secretAccessKey = "<Your Secret Access Key>" AmazonSimpleDB service = new AmazonSimpleDBClient(accessKeyId, secretAccessKey)
Make sure the following line is commented out:
AmazonSimpleDB service = new AmazonSimpleDBMock();
Save the file.
Repeat this procedure for each file in the samples directory.
To prepare the sample files
Extract the Amazon SimpleDB sample code into a directory on your machine designated as <sdb home>.
Open the following sample solution:
<sdb home>/amazon-simpledb-2007-11-07-cs-library/src/Amazon.SimpleDB.sln.
Open the AmazonSimpleDBSamples.cs file.
Determine whether you will run the code against the mock service or your Amazon SimpleDB account:
To run the code against the mock service, comment out the following lines:
String accessKeyId = "<Your Access Key ID>"; String secretAccessKey = "<Your Secret Access Key>"; AmazonSimpleDB service = new AmazonSimpleDBClient(accessKeyId, secretAccessKey);
Then, remove comment marks from the following line:
AmazonSimpleDB service = new AmazonSimpleDBMock();
To run the code against Amazon SimpleDB, make sure the following lines are not commented out and enter your Access Key ID and Secret Access Key:
String accessKeyId = "<Your Access Key ID>"; String secretAccessKey = "<Your Secret Access Key>"; AmazonSimpleDB service = new AmazonSimpleDBClient(accessKeyId, secretAccessKey);
Make sure the following line is commented out:
AmazonSimpleDB service = new AmazonSimpleDBMock();
Save the file.
To prepare the sample files
Extract the Amazon SimpleDB sample code into a directory on your machine designated as <sdb home>.
Open the src/Amazon/SimpleDB/Samples/CreateDomainSample.pl sample file.
Determine whether you will run the code against the mock service or your Amazon SimpleDB account:
To run the code against the mock service, comment out the following lines:
my $AWS_ACCESS_KEY_ID = "<Your Access Key ID>"; my $AWS_SECRET_ACCESS_KEY = "<Your Secret Access Key>"; use Amazon::SimpleDB::Client; my $service = Amazon::SimpleDB::Client->new($AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY);
Then, remove comment marks from the following line:
use Amazon::SimpleDB::Mock; my $service = Amazon::SimpleDB::Mock->new;
To run the code against Amazon SimpleDB, make sure the following lines are not commented out and enter your Access Key ID and Secret Access Key:
my $AWS_ACCESS_KEY_ID = "<Your Access Key ID>"; my $AWS_SECRET_ACCESS_KEY = "<Your Secret Access Key>"; use Amazon::SimpleDB::Client; my $service = Amazon::SimpleDB::Client->new($AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY);
Make sure the following lines are commented out:
use Amazon::SimpleDB::Mock; my $service = Amazon::SimpleDB::Mock->new;
Save the file.
Repeat this procedure for each file in the samples directory.
To prepare the sample files
Extract the Amazon SimpleDB sample code into a directory on your machine designated as <sdb home>.
Open a sample file in the
src/Amazon/SimpleDB/Samples/
directory.
Determine whether you will run the code against the mock service or your Amazon SimpleDB account:
To run the code against the mock service, comment out the following lines:
$AWS_ACCESS_KEY_ID = 'Your Access Key ID';
$AWS_SECRET_ACCESS_KEY = 'Your Secret Access Key';
require_once ('Amazon/SimpleDB/Client.php');
$service = new Amazon_SimpleDB_Client($AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY;
Then, remove comment marks from the following line:
require_once ('Amazon/SimpleDB/Mock.php');
$service = new Amazon_SimpleDB_Mock();
To run the code against Amazon SimpleDB, make sure the following lines are not commented out and enter your Access Key ID and Secret Access Key:
$AWS_ACCESS_KEY_ID = 'Your Access Key ID';
$AWS_SECRET_ACCESS_KEY = 'Your Secret Access Key';
require_once ('Amazon/SimpleDB/Client.php');
$service = new Amazon_SimpleDB_Client($AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY;
Make sure the following lines are commented out:
require_once ('Amazon/SimpleDB/Mock.php');
$service = new Amazon_SimpleDB_Mock();
Save the file.
Repeat this procedure for each file in the samples directory.
To prepare the sample files
Extract the Amazon SimpleDB sample code into a directory on your machine designated as <sdb home>.
Open the following sample:
<sdb home>/amazon-simpledb-2007-11-07-vbnet-library/src/Amazon.SimpleDB.sln.
Open the AmazonSimpleDBSamples.vb file.
Determine whether you will run the code against the mock service or your Amazon SimpleDB account:
To run the code against the mock service, comment out the following lines:
Dim accessKeyId As String = "<Your Access Key ID>" Dim secretAccessKey As String = "<Your Secret Access Key>" Dim service As AmazonSimpleDB = New AmazonSimpleDBClient(accessKeyId, secretAccessKey)
Then, remove comment marks from the following line:
Dim service As AmazonSimpleDB = New AmazonSimpleDBMock()
To run the code against Amazon SimpleDB, make sure the following lines are not commented out and enter your Access Key ID and Secret Access Key:
Dim accessKeyId As String = "<Your Access Key ID>" Dim secretAccessKey As String = "<Your Secret Access Key>" Dim service As AmazonSimpleDB = New AmazonSimpleDBClient(accessKeyId, secretAccessKey)
Then, make sure the following line is commented out:
Dim service As AmazonSimpleDB = New AmazonSimpleDBMock()
Save the file.
The scratchpad is a sample web application that enables you to test and make calls to Amazon SimpleDB without having to set up a programming environment.
To prepare the scratchpad
Copy the scratchpad files to a location on your computer.
Open the index.html file with a web browser. The welcome page appears.
Enter your AWS Access Key ID and your Secret Access Key.
Follow the tutorial described in the remainder of this document.