This is part two of a three-part series on building an IBM DB2 for z/OS mobile application using IBM MobileFirst. Read part one.
Create a simple mobile app that accesses DB2 for z/OS data by using regular SQL statements. Once you've learned these basic steps, you'll be able to design and build more complex apps that leverage your DB2 for z/OS data.
Before you begin, make sure that you've set up your IBM MobileFirst Platform environment by completing the steps in part one
In this post, we'll retrieve a string from SYSIBM.SYSXMLSTRINGS. This is a catalog table that contains mappings between the string and string ID that is used inside XML storage. SYSIBM.SYSXMLSTRINGS contains a set of pre-defined mappings. The following example shows several rows of the SYSIBM.SYSXMLSTRINGS catalog table:
SELECT STRINGID, SUBSTR(STRING,1,60)as STRING, IBMREQD
STRING STRING IBMREQD
1001 product N
1002 description N
1003 name N
To do this, complete the following steps.
1. Create an IBM MobileFirst project:
a. Click File > New > MobileFirst Project
b. Enter Hello2 as the project name
c. Select Hybrid Application
d. Enter Hello2 as the application name
Figure 1 shows the file structure for your new project.
Figure 1: Project File Structure
2. Edit index.html. Define a text field to enter a string ID value and associate that field with a Submit button:
Find DB2 for z/OS XML String from String id