Archive for 2009
CSV data with Python/pureXML
This tutorial is geared towards developers who want to learn how to store data in XML format in a database, connect to DB2 from a Python application, and learn how to convert data from CSV files into XML documents. No prior knowledge of Python is assumed (you will learn how to install it in this tutorial), but it would be advantageous. This tutorial assumes that you use a Microsoft® Windows® operating system, but the code should work on other platforms without modification. When you complete this tutorial, you will have the skills to create powerful Python applications that can communicate and interact with an IBM DB2 database and harness the power that pureXML offers.
IBM® DB2® pureXML® allows you to store XML data natively in a relational database management system, giving you the power and flexibility to report on this data without disturbing the advantages that its XML format offers. In this tutorial, you will learn how to connect to a DB2 database from the Python programming language, importing data about population from the United States Census Bureau. You will use Python to convert this CSV file into XML, before inserting this XML data natively into DB2. Finally, you will use Python to create a command-line application that produces some informative tables that you can access through a menu system.
Read the tutorial at http://www.ibm.com/developerworks/xml/tutorials/x-csvdb2pytut/
Beginning CouchDB is out now
My book “Beginning CouchDB” is now available in the United States, and should be available internationally in the coming days. The final manuscript comes in at exactly 300 pages, and features everything you need to know to get started with the Apache CouchDB database – from installing it on Mac OS X or Linux to creating applications that work with CouchDB data using JavaScript, Python and Ruby. The following are links to Websites where you can purchase the book:
Amazon.com
Barnes & Noble
Borders
Books-A-Million
Amazon.co.uk
Waterstones
WHSmith
Apress (Buy e-Book Version for $27.99)
The following is the Table of Contents for the completed work:
- About the Author
- About the Technical Reviewer
- Acknowledgements
- Introduction
- Part 1: Getting Started
- Chapter 1: Introduction to CouchDB
- What is CouchDB?
- CouchDB: The Story So Far
- Document-Oriented Databases
- CouchDB Documents
- The JavaScript View Engine
- Restful HTTP API
- Futon
- So…Now What?
- Chapter 2: Installing CouchDB on Linux
- Installing CouchDB on Ubuntu Linux 8.10
- Installing CouchDB on Fedora Linux Using yum
- Building CouchDB (and Prerequisites) from Source Code
- Building Erlang
- Building libcurl
- Building ICU
- Building Spidermonkey
- Building Subversion
- Building CouchDB
- Chapter 3: Installing CouchDB on Mac OS X
- Installing the Xcode Developer Tools
- Installing Macports
- Installing CouchDB
- CouchDBX: A One-Click CouchDB Package for Mac OS X
- Chapter 4: Creating Your First CouchDB Database
- Tools of the Trade
- HTTP Requests
- JSON Response
- Using curl
- Creating Your First Database
- Creating Documents in Your Contacts Database
- Getting Started with CouchDB Views
- Summary
- Chapter 1: Introduction to CouchDB
- Part 2: Managing CouchDB Databases
- Chapter 5: Using Futon: The CouchDB Administration Interface
- Creating a Database
- Creating a Document
- Uploading Attachments
- Compacting the Database
- Futon Tools
- Summary
- Chapter 6: Introduction to JSON
- What is JSON?
- Why JSON?
- JSON 101: Syntax and Data Types
- Working with JSON
- Defining JSON Structures
- Looping Through JSON Arrays
- CouchDB and JSON
- Summary
- Chapter 7: Introduction to CouchDB Views
- Creating Views
- Permanent Views
- Design Documents
- Views and the CouchDB API
- Summary
- Chapter 8: Map/Reduce
- What is Map/Reduce?
- Map/Reduce in CouchDB
- Map/Reduce in Futon
- Map/Reduce Views and the CouchDB API
- Map/Reduce vs. SQL Queries
- Word Count Example
- Summary
- Chapter 9: Advanced CouchDB Views
- Advanced Aggregation
- Ordering and Filtering Results
- Working with Related Data
- Summary
- Chapter 5: Using Futon: The CouchDB Administration Interface
- Part 3: Advanced CouchDB Topics
- Chapter 10: Developing CouchDB Applications with CouchApp
- Installing CouchApp
- Your First CouchApp
- Creating CouchTasks: A Simple Task Manager
- Suggested Improvements
- Summary
- Chapter 11: Developing Applications with CouchDB
- Developing in Python with Couchdbkit
- Developing in Ruby with CouchRest
- Creating a Bookmarks Application with CouchDB and Django
- Summary
- Chapter 12: Advanced CouchDB Topics
- Replication
- Compaction
- Fetching Documents in Bulk
- Writing Documents in Bulk
- Show Functions
- Summary
- Chapter 13: Mechanics of CouchDB Deployment
- Measuring Performance
- Configuring CouchDB
- Conflict Resolution
- Security
- Backup
- Fault Tolerance and Load Balancing
- Clustering
- Summary
- Chapter 10: Developing CouchDB Applications with CouchApp
- Appendices
- Appendix A: CouchDB API Reference
- Appendix B: HTTP and curl Reference
- Index
Store Locator in ASP.NET
This tutorial is geared towards developers who want to learn how to store data in XML format in a database, connect to DB2 from a .NET application, and learn how to develop applications that leverage mapping APIs. To follow this tutorial, familiarity with the .NET framework and C# is recommended. You should also have some experience of developing with HTML and/or XML, and of communicating with a database management system using SQL. When you complete this tutorial, you will have the skills to create map-enabled .NET applications powered by a DB2 database using pureXML® to store XML natively.
We live in a connected and open world, one where data flows freely and where a vast amount of useful information can be found on the Web. In the past, if you wanted to find where the nearest store for your favorite retailer was located, you would probably look it up in the telephone directory, find the company’s phone number, call them, and ask for directions to their nearest outlet. This method is a recipe for getting lost, wasting time, and a general frustration for the customer. Today, however, this has all changed. Now you simply open your Web browser and visit the company’s Web site, where you can usually find a “Store Locator” feature that will help you find the store nearest to you, and conveniently plot it on a map to make it easier to find. In this tutorial, you will learn to develop such a feature using C# ASP.NET and an IBM DB2® database.
Read the tutorial at http://www.ibm.com/developerworks/xml/tutorials/x-purexmlasptut/
Alerts using XMPP/SMS
This tutorial is aimed at Web application developers who want to develop database-driven applications that are powered by an IBM DB2 pureXML database. The reader should be familiar with basic PHP code and be able to work with the Windows command prompt in order to follow the tutorial. Some experience with database management systems and the SQL language is also required. By the end of this tutorial, you will learn how to create object-oriented PHP Web applications that take advantage of a pureXML database.
Thanks to the native XML support that pureXML® offers IBM DB2® database developers, you can load XML data directly into your database, freeing up development time to add functionality to your application. Follow along in this tutorial to import an XML file with Euro foreign exchange rates into an IBM DB2 database and use special XQuery and SQL/XML functions to split this XML into separate database rows. You will also create a PHP script that pulls down new rates from the European Central Bank (ECB) Web site each day. Then you will extend the script to send update alerts to a Google Talk user using the XMPP protocol, and to a cell phone by SMS text message using the Clickatell SMS gateway service. Finally, you will create a PHP script that generates a PNG (Portable Network Graphics) graph of this data.
Read the tutorial at http://www.ibm.com/developerworks/xml/tutorials/x-alertxmpptut/
Knowledgebase using PHP
One of the most useful and versatile technologies available in IBM DB2 is its native support for XML data through the pureXML feature. PureXML allows you to store, retrieve, and manipulate XML data alongside and in the same manner as relational data. This enables you to develop applications that harness the advantages of both relational databases and XML data. Such applications can be particularly useful when you have a large amount of XML data that you need to leverage without having to first convert it into a relational structure.
This tutorial gives you step-by-step instructions on how to use PHP to create a Support Knowledge Base system that stores its data using a combination of traditional DB2 relational columns and pureXML columns. The application uses the power of SQL/XML to map XML data as a relational column. This allows you to use PHP to retrieve the data as though it were stored in a relational manner.
Creating applications that use a hybrid of relational data and XML data is easy thanks to the pureXML® feature of IBM® DB2® database servers. In this tutorial, you use PHP to create a Web application that connects to an IBM DB2 Express-C database and stores some of its data in traditional relational database columns, and some of it in native XML columns. You also learn how to use SQL/XML queries to retrieve, insert, update, and delete data from this database. Beyond the hands-on, project-based training, the tutorial equips you with the skills and conceptual knowledge you need to develop your own hybrid applications.
Read the article at http://www.ibm.com/developerworks/data/tutorials/dm-0911db2purexmlphp/
