Archive for November, 2009
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/
Leveraging pureXML, Part 3
In the third and final part of this series on creating applications that interact with an IBM DB2 pureXML database, you will use the popular PHP language to create scripts for publishing and syndicating the status updates in your database across the Web.
First you will allow users to create a Profile Badge in HTML, which permits them to generate a piece of HTML code to paste into their blog or Web site. This will pull the latest status updates from the pureXML database and present them in a pre-defined format. Users will be able to customize the design of the badge, choosing from a selection of sizes and color schemes, and define the number of updates to be displayed. Next, you will create a PHP script to publish the latest status updates in the database as an RSS Feed. Finally, you will create a script that presents all of the status updates in the database to the users with a Post to Twitter button alongside each update. When a user presses this button, the Twitter API will take the specified post and add the update to the Twitter stream of that user.
The pureXML® capabilities of IBM DB2® allow you to store XML natively in a database without modification, while Adobe® Flex® applications can read XML directly and populate Flex user interfaces. In this three-part article series, you will create a microblogging application that takes advantage of pureXML, Web services, and Adobe Flex; and even allows you to publish your microblogging updates on Twitter. In Part 1 of the series, you learned about Web Services and how they are enabled using DB2 pureXML as you created the microblog database and tested it. Part 2 tapped into Adobe Flex and ActionScript to create the user interface of your application. In this article, the final part of the series, you will learn how to use your pureXML Web Services to publish your microblog entries to an HTML page.
Read the article at http://www.ibm.com/developerworks/xml/library/x-db2mblog3/
Leveraging pureXML, Part 2
In Part 2 of my developerWorks article series on creating a microblogging service, I show you how to connect to the Web services created in Part 1 from a Flex application. This application allows you to post new updates to your microblog database and see a list of previous updates.
The pureXML® capabilities of IBM DB2® allow you to store XML natively in a database without modification, while Adobe® Flex® applications can read XML directly and populate Flex user interfaces. In this three-part article series, you will create a microblogging application that takes advantage of pureXML, Web services, and Adobe Flex; and even allows you to publish your microblogging updates on Twitter. In Part 1 of the series, you learned about Web Services and how they are enabled using DB2 pureXML as you created the microblog database and tested it. In this article, Part 2 of the series, you will tap into Adobe Flex and ActionScript® to create the user interface of the application.
Read the article at http://www.ibm.com/developerworks/xml/library/x-db2mblog2/