Solution development using DB2 and InfoSphere MashupHub

Creating various feeds in InfoSphere MashupHub for use with DB2 databases

The popularity of Web applications has given rise to mashups, which allow creation of consolidated information through information aggregation. While mashups are not a new concept, IBM® InfoSphere™ MashupHub provides a single integration tool to combine data from multiple sources. In this article, get an introduction to the use of IBM DB2® with InfoSphere MashupHub, and learn to create both pureXML feeds and Relational Database Query feeds for use with the DB2 database.

Share:

Ming-Pang Wei (mingpang@ca.ibm.com), DB2 Common Client Technology Analyst, IBM

Ming-Pang Wei joined IBM in 2001 and has held various roles within IBM Canada and IBM Australia. He is an IBM Certified Solutions Expert in Database Administration and Application Development. Currently, he is working as a DB2 Common Client Technology analyst in the IBM Toronto Lab where he helps customers and vendors get the best out of their applications and DB2. He co-authored an IBM Redbook, "DB2 9 pureXML Guide".



John Chun, DB2 Common Client Technology Analyst, IBM

John Chun is a specialist of the DB2 Common Client Technology team working in the area of application development and tooling. He has worked in the IBM DBT Toronto lab for nine years resolving DB2 application issues with various languages including Java, C, C++, Perl, REXX, C#, and others. John has worked on a number of projects involving the DB2 CLI and OLEDB driver, as well as the .NET data provider. John is a DB2 Certified Solutions Expert and Certified WebSphere Administrator.



09 April 2009

Also available in Spanish

Introduction

Information transfer and dissemination are key to most Web applications. As demand for information increases, a large number of Web applications no longer rely on a single source for their content, but instead pull information from multiple sources to produce a comprehensive overview. Mashups provide a simplified means to combine data from numerous sources and publish the data in a standardized format. This article concentrates on creating various feeds for use with DB2 databases.


IBM Mashup Center architecture overview

The IBM Mashup Center gives you the means to create a mashup solution with relative ease through five functional components. These components provide the following capabilities:

  • The ability to create consumable feeds from various sources with ease
  • The ability to quickly assemble new mashups through drag and drop tool
  • The ability to easily publish mashups, widgets, or feeds to a centralized catalog for user discovery and reuse
  • The ability to mix and transform information feeds into new feeds calls data mashups
  • The ability to generate widgets rapidly without coding using Lotus Widget Factory

The IBM Mashup Center consists of Lotus Mashups and InfoSphere MashupHub products, as summarized in Figure 1:

Figure 1. The IBM Mashup Center
The IBM Mashup Center

Requirements

There are system and software requirements you have to consider before deploying IBM Mashup Center and DB2 database. This article does not cover the installation or configuration process for IBM Mashup Center or DB2 database, as there are various other articles covering those topics. Here is a summary of various requirements:

IBM Mashup Center requirement

IBM Mashup Center is currently supported on the following operating systems:

  • Microsoft Windows Server 2003, Enterprise Edition with Service Pack 1 (32bit)
  • Microsoft Windows Server 2003, Standard Edition with Service Pack 2

Further details regarding IBM Mashup Center requirements can be found on the "Detailed System Requirements for IBM Mashup Center" page (see Resources).

Browser requirements

The following browsers are supported for use with MashupHub:

  • Mozilla Firefox 2
  • Internet Explorer 7 or later
  • Safari 3.1 (on Mac OS)

DB2 requirements

DB2 9.x is recommended, as this provides the option of using the pureXML feed. DB2 database may reside either locally or remotely on any platform. For more details regarding the requirements for DB2 9.x, see the "DB2 for Linux, UNIX, and Windows system requirements" page (see Resources).


Setting up DB2 for use with Mashup

The InfoSphere MashupHub uses Apache Derby as its default catalog database. However, other relational databases, including DB2, IBM Informix® Dynamic Server, Microsoft® SQL Server, and Oracle database can be used as the catalog database for InfoSphere MashupHub. The following section discusses the steps required for using DB2 as the catalog database for InfoSphere MashupHub.

Using DB2 as the catalog database

The following steps demonstrate switching the default catalog database to a DB2 database:

  1. Create a new DB2 UTF-8 (Unicode) database with any name of your choice. Please note the database must be explicitly created with codeset UTF-8. The following command is used to create a UTF-8 database called mycat:
    Listing 1. Create Catalog Database Command
    db2 CREATE DB mycat USING CODESET UTF-8 TERRITORY US
  2. Log on to the InfoSphere MashupHub as an administrator and click on Settings next to the search field at top of the screen.
  3. Click on Migrate Database in the Administrator Tasks panel on the right side of the screen.
  4. Select DB2 as Database type and fill in the required Hostname, Port number, Database Name, Schema, Username, and Password. The Username must have proper privileges to create tables and schemas.
    Figure 2. Migrate MashupHub Database window
    Migrate MashupHub Database window
  5. Click on the Migrate button to complete the process. This creates all the necessary database objects in the specified DB2 database and migrates data from the default Apache Derby database.

Enabling pureXML

DB2 9.x introduced pureXML, where XML data is natively stored as XML the data type in the database and allows XQuery to query the XML data without needing to decompose the XML data. The pureXML feed can be created for use with a DB2 database that contains XML data. However, in order to create the pureXML feed, you must take the following steps on the DB2 9.x database:

  1. Locate the purexml_files.zip file located in Hub\installedApps\Mashup Hub.ear\mashuphub-enterprise.war\server\plugins\com.ibm.mashuphub.plugin.purexml\ subpath of your IBM Mashup Center install directory. For example, if you have installed the IBM Mashup Center in the default directory, purexml_files.zip would be located in following path: C:\Program Files\IBM Mashup Center\Hub\installedApps\Mashup Hub.ear\mashuphub-enterprise.war\server\plugins\com.ibm.mashuphub.plugin.purexml\
  2. Unzip the purexml_files.zip. This creates a folder called purexml_files.
  3. Copy everything from the classes directory under purexml_files to a subpath of db2 instance, SQLLIB\function directory.
  4. Connect to the database and run the scripts table.db2, storproc.db2, and atom_c_enable_storeprocedure.db2 from <db2instance>\SQLLIB\function directory. These scripts create necessary tables, stored procedure, and a view that are needed for the pureXML Enablement. Commands to run in DB2 Command Window:
    db2 connect to sample
    db2 -td@ -vf table.db2
    db2 -td@ -vf storproc.db2
    db2 -td@ -vf atom_c_enable_storeprocedure.db2

    Note: When this article was written, atom_c_enable_storeprocedure.db2 did not require the @ delimiter at end of the file. Please add @ at end of the script. Do not make any other changes to these scripts.

  5. Call stored procedure IBMATOM.ENABLE_TABLE_FOR_ATOM to enable table for pureXML feed. In order to enable table <userSchema>.CUSTOMER for the pureXML feed, issue the following command:
    db2 CALL IBMATOM.ENABLE_TABLE_FOR_ATOM('<userSchema>.CUSTOMER')

Browser interface of InfoSphere MashupHub

The InfoSphere MashupHub is a browser-based tool, which is the first interface remote users will encounter. It has four parts under the Home tab — Catalog, Create, Community, and Getting Started.

  • MashupHub Catalog:The Catalog is a repository of existing mashup objects: Feeds, Widgets, and Pages. All the listing options open a corresponding tab, listing all objects of specified type with title, tags, last updated timestamp, rating, and author. There is also a search feature on the top of the page with scope All, My favorites, Widgets, Pages, and Feeds.
    • Tag: Used for classification of mashup objects
    • Category: Keyword(s) used to group mashup objects in a meaningful way
    • Rating: Allows community member to evaluate a mashup object using 0- to 5-star rating
  • Mashup Create: The Create allows creation of a mashup object with ease. You can create feed, feed mashup, or upload widget, as well as a page.
  • Mashup Community: The Community is similar to Catalog. It is intended to be an online community where existing mashup objects can be shared. However, instead of sorting mashup objects according to object type, it provides a listing of existing available mashup objects sorted by most recent changed, highest rated, most viewed , most discussed, as well as tags and categories.
  • Mashup Getting Started: This section provides you with examples and tutorials.

Feed, feed mashup, widget, and page

This section briefly discusses the various mashup objects you can create or upload to InfoSphere MashupHub.

  • Feed: A feed consists of XML data that can be created from various data sources. A feed may contain headlines, articles, summaries, and links to external contents along with metadata. The three main type of feeds include:
    • RSS
    • Atom
    • XML
  • Feed mashup: The Feed mashup is an aggregate of existing feeds, where an existing feed is used as the source of data. A feed mashup can be created using feed mashup builder.
  • Widget: A widget is a portable set of code that can be installed and executed within the HTML-based Web page without compilation. A widget can trigger events and metadata that describes event types associated with it, allowing for dynamic content on the page.
  • Catalog: A catalog is a repository of all mashup objects.

Mashup feeds available in InfoSphere MashupHub

InfoSphere MashupHub provides a means to simply add an existing feed that is already available through Internet or to create a new feed from a variety of data sources. Creating a new feed is a simple process that can be completed through a couple of steps in the MashupHub create tool. You can easily create a custom feed for contents that is dynamic in nature using InfoSphere Mashup Hub from the following data sources:

  • DB2XML columns (pureXML)
  • Relational databases (SQL)
  • IBM Information Server
  • IBM Information Management System (IMS)
  • IBM Domino® server databases
  • IBM Tivoli® Directory Integrator (TDI) services
  • Comma Separated Value (CSV) files
  • LDAP servers
  • SAP servers
  • WSDL Web services
  • XML documents
  • Microsoft Access databases
  • Microsoft Excel worksheets

Feeds created or registered in the InfoSphere MashupHub can have one of following permissions:

  • Public: All users can view the feed
  • Private: Feed is only available to a user who registered the feed
  • Custom: Feed is defined by custom permission settings

The next section covers the use of a Relational Database feed and a DB2XML Columns (pureXML) feed with DB2 in further detail. These examples utilize DB2 sample database that was created with tables containing XML data type. If DB2 sample database is not already present in your DB2 install, you can create it by issuing the following command from the DB2 Command Window:

db2sampl -xml

Creating Relational Database Query feed for DB2

In this example, create a Relational Database Query feed using the PURCHASEORDER table from the SAMPLE database.

  1. Log on to the MashupHub from a browser.
  2. Select New Feed from the Create section in the Home tab.
  3. Select Relational Database Query (SQL) under the enterprise section (as shown in following Figure 3), then click on the Next button to proceed:
    Figure 3. Select the feed data source window
    Select the feed data source window
  4. You are now presented with the "Specify the database connection information" window, as shown in Figure 4:
    Figure 4. Specify the database connection to use window
    Specify the database connection to use window
  5. Select New from the drop-down menu of the Select feed, and choose DB2 from drop-down box for the feed Type.
  6. Type in the DB2 database name, host name where the target database resides, and listener port number for target data source.
  7. Specify user name and password, then click on the Next button.
  8. From the "Enter an SQL query" window, select one or more tables of your choice. A list of columns will be displayed on the right side panel in form of schema.tablename.columnname (as shown in Figure 5).

    Note that if multiple tables are chosen, the MashupHub will create the simplest join of the chosen tables. Therefore, it is always best to use the advance section at the bottom of the screen and issue an explicit SQL join statement to ensure that the desired output is obtained when multiple tables are being selected.

    For this scenario, select the PURCHASEORDER table from the sample database, and select all the columns from the PURCHASEORDER.
    Figure 5. Enter an SQL query window
    Enter an SQL query window
    (Click here to see a larger image of Figure 5.)
  9. Click on the Next button to continue.
  10. In the "Specify the following information" window, enter Order for Title, customer purchase order for Description, and 1.0 for Version, as shown in Figure 6:
    Figure 6. Specify the following information window
    Relational4
  11. Select permissions of your choosing. In this scenario, make the given feed available to all by choosing Public.
  12. Click on the Finish button to complete the feed creation. The "Feed successfully saved" window is presented upon successful feed creation.
  13. From the "Feed successfully saved" window, select View feed to view the feed output.

Creating pureXML feed for DB2

Note:

Before proceeding, ensure that the target DB2 9.x database has been enabled for pureXML per the instruction outlined in "Enabling pureXML" section.

In this example, create a pureXML feed that contains customer id (Cid), customer name, and city information obtained from XML data with in the INFO column of the CUSTOMER> table.

  1. Log on to the MashupHub from a browser.
  2. Select New Feed from the Create section in the Home tab.
  3. Select DB2 XML Columns (pureXML) under the enterprise section (as shown in Figure 7), then click on the Next button to proceed:
    Figure 7. Select the feed data source window
    Select the feed data source window
  4. You are now presented with the "Specify the database connection information" window. Select New from the drop-down menu of the Select feed, and choose DB2 from the drop-down menu for the feed Type.
  5. Type in the DB2 database name, host name where target database resides, and listener port number for target data source, as shown in Figure 8:
    Figure 8. Specify the database connection information window
    Specify the database connection information window
  6. Also, specify the user name and password you wish to make connection with, then click on the Next button.
  7. From the "Specify the options for the PureXML feed" window, select the DB2 Data tab.
  8. Click on the down arrow icon next to the "DB2 Table" field (you can not type into this field). It lists all the XML columns in the database.
  9. Select <Schema>.customer > info from the list. This will automatically populate the DB2 Table and DB2 Column, as shown in Figure 9:
    Figure 9. DB2 Data tab - Specify the options for the pureXML feed window
    DB2 Data tab - Specify the options for the pureXML feed window
  10. Click on the Content tab at the top.
  11. Click on the down arrow icon next to the "Entry Title" field. A new window listing various elements in selected XML Column is displayed.
  12. Select Cid=1000 from the list.
  13. Click on the down arrow icon next to the "Entry Summary" field, and choose the city element.
  14. Click on the down arrow icon next to the "Entry Author" field, and select the name element. (Steps 10 - 14 are illustrated in Figure 10.)
    Figure 10. Content tab - Specify the options for the PureXML feed window
    Content tab - Specify the options for the PureXML feed window
  15. Click on the Criteria tab at the top. You can now choose which rows can be represented in a given Atom feed.
  16. For this example, choose the top element, which shows all rows.
  17. Click on the down arrow icon next to the "Row Conditional" field, and select customerinfo, as shown in Figure 11:
    Figure 11. Criteria tab - Specify the options for the PureXML feed window
    Criteria tab - Specify the options for the PureXML feed window
  18. Click on the Length tab to specify how many row summaries you want to display.
  19. Enter the value 2 in the Maximum field (see Figure 12), then click on the Next button:
    Figure 12. Length tab - Specify the options for the PureXML feed window
    Length tab - Specify the options for the PureXML feed window
  20. In the "Specify the following information" window, enter customerinfo for Title, customer information for Description, and 1.0 for Version.
  21. Select permissions of your choosing. In this scenario, make given feed available to all by choosing Public, as shown in Figure 13:
    Figure 13. Specify the following information window
    Specify the following information window
  22. Click on the Finish button to complete the feed creation. The "Feed successfully saved" window is presented upon successful feed creation.
  23. From the "Feed successfully saved" window, select View feed to view the feed output.

Existing feeds can be further aggregated into feed mashup. The following example demonstrates the creation of a feed mashup using the previously created feeds.

Creating Feed mashup

  1. Log on to the MashupHub from a browser.
  2. Select New Feed Mashup from the Create section in the Home tab. This brings up the feed mashup builder, as shown in Figure 14:
    Figure 14. Mashup builder window
    feedmashup1
  3. Drag a Source operator under the Operators pane on the left, and drop it on to the canvas on right.
  4. The "Details for the Source operator" window is displayed. Enter the value order for the Name field in the Properties tab, as shown in Figure 15:
    Figure 15. Details for the Source operator window (First source)
    Details for the Source operator window (First source)
  5. Select the From Catalog radio button in the Source section, and click on the Browse button. This allows you to choose an existing feed from the catalog.
  6. Select the Order feed, which you created for the Relational Database Query feed example above, then click on OK button.
  7. Close the "Details for the Source operator" window.
  8. Drag another Source operator under the Operators pane on left, and drop it on to the canvas on right.
  9. The "Details for the Source operator" window is displayed. Enter the value customer for the Name field in the Properties tab, as shown in Figure 16:
    Figure 16. Details for the Source operator window (Second source)
    Details for the Source operator window (Second source)
  10. Select the From Catalog radio button in the Source section, and click on the Browse button.
  11. Choose customerinfo feed, which you created for the pureXML feed in the example above, then click OK button.
  12. Close the "Details for the Source operator" window.
  13. Drag a Merge operator under the Operator pane on the left, and drag it on to a canvas on the right.
  14. Drag the plug (little stub on the right side of the Source operator icon) of each source operator to the socket of the Merge operator.
  15. Merging of the customerinfo feed and the order feed will be done using the customer id. Double-click on the Merge operator to open the "Details for the Merge operator" window.
  16. Enter make in the Name field.
  17. Select first input as order and second input as customer.
  18. In the First Input Value field, expend the tree by clicking on the down arrow icon on the right.
  19. Expand to entry > content > row > custid by clicking on the + symbol (plus sign).
  20. Select the text under the custid element to populate the First Input Value field (this is the XPath).
  21. In Comparison field, choose the = symbol (equal sign) from the drop-down menu.
  22. From the Second Input Value field, select the down arrow icon to display the tree as before.
  23. Now expand to entry > title.
  24. Select the text under the title element.
  25. Close the "Details for the merge operator" window. The result is similar to the screen shown in Figure 17:
    Figure 17. Details for the Merge operator window
    Details for the Merge operator window
  26. Drag the plug of the merge operator (labeled make) to the socket of the Publish operator, as shown Figure 18:
    Figure 18. Canvas window
    Canvas window
  27. Click on Save at the top left of the screen.
  28. This opens the "Specify the following information" window. Enter customer order in the Title field, merge customer info with order in the Description field, and 1.0 in the Version field.
  29. Select the Public radio button for the Permissions.
  30. Click on the Finish button to complete the process.
    Figure 19. Specify the following information window
    Specify the following information window
  31. From the "Feed Mashup successfully saved" window, select View feed mashup to view the feed output.

Solution example

Using various feeds introduced in previous section, this section demonstrates a feed mashup solution that combines information from various data sources. In this example, create a feed that summarizes the total sale a company made to its customer. The feed will list customer name, customer ID, and total sale made to a given customer in descending order. The scenario involves sales of an item, in this case boxes to various customers. Each different type of box has a different price. In this example, you will create a mashup feed based on feeds from three different data sources:

  • Pricing information (pricing.xls): List of current price for each item (Box type).
  • Customer information (CUSTOMER): This will reside on the customer table in DB2 database. You will utilize the CUSTOMER table in the SAMPLE database.
  • Shipped item information (SHIPPEDORDER): This table contains shipping ID, Customer ID, type of box ordered, number ordered, and date ordered.

The scripts for creating the SHIPPEDORDER table and a sample spread sheet are included in zip file available for download.

  1. You first need to create a feed for the pricing spread sheet:
    1. Create a feed as you did before, but specify Excel Workbook from the "Select the feed data source" window.
    2. In the "Specify information about the Microsoft Excel XLS worksheet file" window, leave everything to default (blank), except for the Filepath.
    3. Click on the Browse button, select the pricing.xls file, and click on the Next button.
    4. Specify Title as Pricing, Description as Box price and Leave the Version as 1.0. Complete the feed creation step as before.
  2. Next, create a Relational Database Query feed for SHIPPEDORDER table:
    1. Create a Relational Database Query feed as before.
    2. Select SHIPPEDORDER table and all its columns.
  3. Create a pureXML feed for the CUSTOMER table in the SAMPLE database:
    1. Create a pureXML feed as before.
    2. Choose CUSTOMER table.
    3. In the "Specify the options for the PureXML feed" window, select Cid element for Entry Title, name element for the Entry Summary, and city for the Entry Author.
  4. Select New Feed Mashup from the Create section in the Home tab.
  5. Create Source operators for the above three feeds.
  6. Create Transform operators for each Source. (This is to filter input information from the source.)
  7. Drag the three Transform operators in to the canvas.
  8. Insert plug from each Source to one of the Transform operators.
  9. Click on the plugged-in Transform operator to open the "Details for the Transform Operator" window. In this example, the Transform operators are labeled as CTransform (for Customer Source), STransform (for SHIPPED ORDER source) and PTransform (for Pricing Source).
    1. For the Customer Transform (CTransform) operator:
      1. Create a new element called customer under the entry element for the Output.
      2. Create new elements name and cid under the newly created customer element.
      3. Drag the corresponding element text from the Input panel to the newly created elements in the Output panel.
    2. For the Shipped Order Transform (STransform) operator:
      1. Create a new element called shipment under the entry element for the Output.
      2. Create new elements sid, custid, type_of_box_ordered, and number_ordered.
      3. Drag the corresponding element text from the Input panel to the newly created elements in the Output panel.
    3. For Pricing Transform(PTransform) operator:
      1. Create a new element called pricing under the entry element for the Output.
      2. Create new elements col_A and col_B.
      3. Drag the corresponding element text from the Input panel to the newly created elements in the Output panel.
  10. Create a Merge operator called CSMerge and plug-in the sockets from CTransform and STransform.
  11. Ensure that First Input in the "Details for the Merge operator" window is set to CTransform and Second Input is set to STransform. The first input value should be text (for example, 1000) from cid, and the second input value should be text from custid. The Comparison should be = (equal).
  12. Create another Merge operator called PCSMerge, and plug-in the sockets from CSMerge and PTransform.
  13. Ensure that First Input in the "Details for the Merge operator" window is set to CSMerge and Second Input is set to PTransform. The first input value should be text (for example, 1) from type_of_box_ordered, and the second input value should be a text from col_A. The Comparison should be = (equal).
  14. Create a new Transform operator called PCSTransform.
  15. Plug-in the socket from PCSMerge to the PCSTransform operator.
  16. Click on the PCSTransform operator to open the "Details for the Transform Operator" window.
  17. Create a new element called ranking under the entry element for the Output.
  18. Create new elements amount, name, and custid.
  19. Drag the corresponding element text from the Input panel to the newly created elements in the Output panel.
  20. Create a new Group operator that will group PCSTransform output.
  21. Plug-in the socket from PCSTransform to the Group operator.
  22. Click on the Group operator to open the "Details for the Group operator" window.
  23. In the Group element, select custid then click on the + (plus sign) icon at the bottom of the field. This opens another field.
  24. On the second field, choose name.
  25. In "Associated data elements", choose name for the first field, and select amount for the second field.
  26. Close the window to complete the process.
  27. Create a new Transform operator called PCSGTransform and plug-in the Group socket.
  28. Click on the PCSGTransform operator to open the "Details for the Transform Operator" window.
  29. Create a new element called ranking under the entry element for the Output.
  30. Create new elements custid, total, and name under the ranking element.
  31. Drag the corresponding element text from the Input panel to the newly created elements in the Output panel.
  32. Create a Sort operator called Sort.
  33. Plug-in the socket from PCSGTransform.
  34. Click to open the "Details for the Sort operator" window.
  35. Specify total for the Sort Value, and choose Descending for the Sort Order, then close the window.
  36. Create a new Transform operator called Transform.
  37. Plug-in the socket from the Sort operator to the Transform operator.
  38. Click on the Transform operator to open the "Details for the Transform Operator" window.
  39. Create new elements title, id, updated, summary, and content under the entry element for the Output.
  40. Create an attribute named type under the title element, and set attribute value to text.
  41. Right-click on the id element to choose Specify a function value, then left click on the highlighted Specify a function value selection. This opens the "Choose function" window.
  42. Choose UUID from the "Select a function" drop-down menu, then click on Ok.
  43. Create a timestamp text under the updated element.
  44. Create an attribute type under the summary element, and set the value to text.
  45. Create attribute type under the content element, and set the value to application/xml.
  46. Drag the corresponding element text from the Input panel to the newly created elements in the Output panel.
  47. Create an element row under the content element.
  48. Drag custid, total, and name from the Input panel to the row element in the Output panel.
  49. Plug-in the socket from the Transform operator to the Publish operator.
  50. Click on the Publish operator to open the "Details for the Publish operator" window, and specify Feed Type of ATOM, and fill in the Title and Author fields.
  51. Leave the Id and Link fields at default.
  52. Close the window. Figure 20 shows all the operators involved:
    Figure 20. Solution overview
    Solution overview
  53. Click on Run at the top left of the screen to see the feed output.
  54. Now click on Save. This opens the "Specify the following information" window.
  55. Specify Customer Ranking as the Title, and write a short description in the Description field.
  56. Click on Finish to complete the process.
  57. From the "Feed Mashup successfully saved" window, click on Add to Lotus Mashups.
  58. Specify Customer Ranking in the Title field of the "Add to Lotus Mashups" window.
  59. Select category Demo from the drop-down menu for Category, then click on Finnish.

You can now bring up Lotus Mashups and create a new page. Change to the edit mode, then find the Customer Ranking among the Demo, and add it to the page. You should then see output such as those shown in Figure 21:

Figure 21. Solution output
Solution output

InfoSphere MashupHub log and trace

Several logs are associated with IBM Mashup Center. The following list contains log files associated with IBM Mashup Center (they are located under the install directory of the IBM Mashup Center):

  • \Hub\installedApps\Mashup Hub.ear\mashuphub-enterprise.war\META-INF\logs\javamashuphub.log
  • \mm_profile\javamashuphub.log
  • WAS application server log
    • \mm_profile\logs\server1\native_stderr.log
    • \mm_profile\logs\server1\native_stdout.log
    • \mm_profile\logs\server1\startServer.log
    • \mm_profile\logs\server1\stopServer.log
    • \mm_profile\logs\server1\SystemErr.log
    • \mm_profile\logs\server1\SystemOut.log
  • Metadata database log (derby.log, db2diag.log)
  • \AppServer\derby\derby.log
  • \Config\derby.log
  • \Config\javamashuphub.log

The core log file for the InfoSphere MashupHub is called javamashuphub.log, which is located in <InstallPath>\Hub\installedApps\Mashup Hub.ear\mashuphub-enterprise.war\META-INF\logs\

This is the primary log used by mashup feed builder and feed creation tools.

You can also enable tracing in InfoSphere MashupHub by making modifications to the log4j.properties file, located in the \Hub\installedApps\Mashup Hub.ear\mashuphub-enterprise.war\WEB-INF\classes path. Required modification involves changing default entries to the following:

log4j.rootLogger=TRACE,FILE
log4j.logger.com.ibm.mashuphub=DEBUG,CONSOLE
log4j.logger.com.ibm.mmms=DEBUG,CONSOLE
log4j.appender.CONSOLE.Threshold=DEBUG
log4j.appender.FILE.Threshold=TRACE

You need to stop and restart the InfoSphere MashupHub for change to take effect and tracing to start.


Summary

This article presented how feeds and mashup feeds can be easily created using the InfoSphere MashupHub. The InfoSphere MashupHub provides means to easily register and create new feeds from various data sources. It also provides a simple GUI interface and catalog of existing feeds for rapid development of a mashup solution. Combined with the pureXML feature available in DB2 9.x, InfoSphere MashupHub allows effortless creation of mashups from existing XML data stored in various DB2 9.x databases.


Download

DescriptionNameSize
Sample script for solutions exampledownload.zip2KB

Resources

Learn

Get products and technologies

  • DB2 Express-C: Now you can use DB2 for free. Download DB2 Express-C, a free version of DB2 Express Edition for the community that offers the same core data features as DB2 Express Edition and provides a solid base to build and deploy applications.
  • IBM Mashup Center: Download a trial version of IBM Mashup Center to try the solution example described in this article.
  • Build your next development project with IBM trial software, available for download directly from developerWorks.

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Information management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management
ArticleID=380989
ArticleTitle=Solution development using DB2 and InfoSphere MashupHub
publish-date=04092009