Using the AWS SDK for Java

By: Emiley J Emailed: 1768 times Printed: 2515 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

Download the AWS SDK for Java from the SDK web page at http://aws.amazon.com/sdkforjava. After downloading the SDK, extract the contents into a folder.

The SDK /samples folder includes a number of code samples:

  • Console sample – Demonstrates how to make a request to multiple services.
  • Amazon S3 sample – Demonstrates how to use the basic features for Amazon S3, such as putting and getting an object from Amazon S3.
  • Amazon SimpleDB sample – Demonstrates how to use the basic features for Amazon SimpleDB, including creating and deleting domains, and selecting data from a domain.
  • Amazon SQS sample – Demonstrates how to use the basic features of Amazon SQS, including adding and getting messages from a queue.

To run a sample

  1. Open the AwsCredentials.properties in the sample folder. For example, the Console sample file is located at aws-java-sdk/samples/AwsConsoleApp/AwsCredentials.properties.
  2. Locate the following section and fill in your Access Key ID and Secret Access Key:

    # Fill in your AWS Access Key ID and Secret Access Key
    # http://aws.amazon.com/security-credentials
    accessKey =
    secretKey =

  3. Save the file.
  4. Run the .java file for your sample, located in the same directory as the properties file. For example, run the aws-java-sdk/samples/AwsConsoleApp/AwsConsoleApp.java file for the Console sample. The sample prints information to the standard output, for example:

    ===========================================
    
      Welcome to the AWS Java SDK!
    
    ===========================================

     

    You have access to 4 Availability Zones.
    You have 0 Amazon EC2 instance(s) running.
    You have 13 Amazon SimpleDB domain(s)containing a total of 62 items.
    You have 23 Amazon S3 bucket(s), containing 44 objects with a total size of 154767691 bytes.

NOTE: Each sample also includes an Ant build.xml file to run the sample. For more information on Ant, see http://ant.apache.org.


Java Home | All Java Tutorials | Latest Java Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(0)


Be the first one to add a comment

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Emiley J
Password must include both numeric and alphabetic characters - Magento
What is Hadoop?
Returning multiple values from a web service
Tomcat and httpd configured in port 8080 and 80
Java Webservices using Netbeans and Tomcat
Java WebService connected to Database
How to Deploy a Java Web Service
Call a webservice in Java
Java WebService - Create your first web service in Java
package javax.jws does not exist
Getting Started with Android
HTML5 Location - getCurrentPosition() in HTML5
HTML5 Canvas - Using Canvas in HTML5
HTML5 - Introduction
HTML5 Video - Handling video in HTML5

More Tutorials in Java
Update contents of a file within a jar file
Tomcat and httpd configured in port 8080 and 80
Java File
Java String
Count number of vowels, consonants and digits in a String in Java
Reverse a number in Java
Student marks calculation program in Java
Handling Fractions in Java
Calculate gross salary in Java
Calculate average sale of the week in Java
Vector in Java - Sample Program
MultiLevel Inheritance sample in Java
Multiple Inheritance sample in Java
Java program using Method Overriding
Java program to check if user input is an even number

More Latest News
Most Viewed Articles (in Java )
A Serialization Example in Java
Using One-Dimensional Arrays in Java
Method Overriding in Java
Type Casting in Java
instanceof sample program in Java
indexOf( ) and lastIndexOf( ) in Java
The java Buzzwords
Write to a file in Java - Sample Program
XML and Java - Parsing XML using Java Tutorial
Student marks calculation program in Java
Handling Fractions in Java
Calculate average sale of the week in Java
Java program to check if user input is an even number
Using the AWS SDK for Java
How to create an array and method in JSP
Most Emailed Articles (in Java)
Converting a number into its equalant value in words in Java
java.lang.reflect package
Disadvantages of using Native methods in Java
What is UCS? What is ISO 10646?
Generating Your Key Pair example using keytool in Java
Operator Precedence in Java
PushbackReader sample program in Java
concat(), replace(), and trim() Strings in Java
instanceof sample program in Java
Use of - new - in Java
The Benefits of OOP
Increment and Decrement Operator
Characters in java
The continuing Revolution of java
Why java is important to the Internet