Java Industry News
Updated Simple Java API class for Amazon SimpleDB
I have added a couple of new methods to catch the new methods added by Amazon to SimpleDB
By: Alan Williamson
Oct. 17, 2008 09:00 AM
Back in July I made some enhancements to this class by adding a very simple in-class XML parser that would pull back the results in a format that the calling class could actually use.
I have added a couple of new methods to catch the new methods added by Amazon to SimpleDB. Namely the QueryWithAttributes directive that lets you pull back all the attributes for a given Item that matches the query results. This makes querying SimpleDB even more efficient as you can get all your data in one call.
As usual, you can get at this data as a List of HashMap's.
SimpleDB sDb = new SimpleDB( amzID, amzKey ); List
I also added in a new method to delete a whole record from SimpleDB given a domain and an Item.
SimpleDB sDb = new SimpleDB( amzID, amzKey ); sDb.deleteItem( amzDomain, item);
Now if anything goes wrong, with any of the calls, an Exception is thrown. Remember, if you delete something and straight afterwards do a query, you may still see it, that's because of Amazon's caching and updating mechanisms.
Thanks again to Ian Schumacher for developing the original class and making it available on Amazon under a very liberal license (Absolutely free in all senses of the word, absolutely no restrictions, no attribution necessary).
In the same spirit, I include the updated version of that code here, to be used in the same spirit as the original author. Just "Copy and Paste" It!
Cloud Computing Bootcamp
Alan Williamson, founder of Blog-City.com, is a Sun Java Champion and creator of OpenBlueDragon (an open source Java CFML runtime engine). He is currently engaged with a number of startups providing technology and expertise. He has worked with SpikeSource for nearly three years as technical evangelist and architect in SpikeLabs. He has assisted VCs in preparing technical overview and due diligence, was editor-in-chief of Java Developer's Journal, founding editor of LinuxWorld Magazine, and has more than 16 years of experience in the world of software development.
Reader Feedback: Page 1 of 1
Latest AJAXWorld RIA Stories
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
SYS-CON Featured Whitepapers
Most Read This Week