Print Email

Build an IBM DB2 for z/OS Mobile Application With IBM MobileFirst

Part One: Setting Up The Environment

1/6/2016 12:00:31 AM | This is part one of a three-part series on building an IBM DB2 for z/OS mobile application by using IBM MobileFirst. Read part two.

Because of its quality of service, high availability, security and performance, many organizations rely on IBM DB2 for z/OS to store critical transactional data. Now that we've entered a new era in which we increasingly use our phones and tablets for all types of transactions—everything from shopping and banking to social interaction and research—mobile access to DB2 for z/OS transactional data is more critical than ever.

The IBM MobileFirst Platform is ideal for developing and testing mobile applications that access DB2 for z/OS transactional data. IBM MobileFirst combines multiple tools, frameworks and code bases into a single development environment, which means only one code base to develop and maintain.

In Figure 1, a mobile application, shown on the left, accesses the IBM MobileFirst server, which provides a set of adapters for server-side development.

Figure 1: Simplified View of the IBM MobileFirst Architecture

This post is the first of three that will show you how to build a DB2 for z/OS mobile application by using IBM MobileFirst. This post shows you how to set up an IBM MobileFirst Platform environment. Two subsequent posts are based on two common development scenarios:

  • How to retrieve a string from a string ID from the SYSIBM.SYSXMLSTRINGS table by using regular SQL statements
  • How to execute RUNSTATS for a database and table space by calling a stored procedure
To set up an IBM MobileFirst Platform environment that will enable you to write applications that access DB2 for z/OS data, complete the following steps.

1. Install IBM MobileFirst Developer Studio, which is part of IBM MobileFirst Developer Edition.

2. Locate and record the location of db2jcc.jar and db2jcc_license_cisuz.jar, which are included with DB2 Connect. You'll need this information to complete step 4.

3. If you want to develop native Android applications or if you want to test your applications in an Android emulator, complete these steps:
    a. Install Oracle JRE 7 (JRE 8 is not yet supported)
    b. Install the Android SDK. Scroll to Other Download Option > SDK Tools only.
    c. Install the ADT Eclipse plug-in and Inside Eclipse:
        i. Click Help > Install New Software.
        ii. Click Add, and enter the location
        iii. Select Developer Tools and follow the installation prompt.
    d. Add the SDK. From within Eclipse, click Window > Android SDK Manager. By default, the latest API level is installed, but it's recommended that you also install API level 19.
    e. Add a virtual device (emulator). In Eclipse, click Window > Android Virtual Device Manager. Click Create to create a new Android Virtual Device (AVD). Figure 2 shows the AVD that we used.

Figure 2: Android Virtual Device Information

4. Edit MobileFirst Development Server > servers > worklight > server.xml and add <library>,<dataSource>, similar to the following code sample. We'll reference the database that we define here in the subsequent posts.

  <library id="db2jcc">

   <fileset dir="C:\JCCJars\JCC411"
            includes="db2jcc4.jar db2jcc_license_cisuz.jar"/>

   <dataSource id="db2" jndiName="dtec222">
      <jdbcDriver libraryRef="db2jcc"/>
      <properties.db2.jcc databaseName="STLEC1"
   <dataSource id="db2_serveros" jndiName="zserveros">
      <jdbcDriver libraryRef="db2jcc"/>
      <properties.db2.jcc databaseName="EOSDBV11"


Now that the IBM MobileFirst Platform environment is set up, you're ready to start building mobile applications that access DB2 for z/OS data. The next article in this series will show you how to use regular SQL statements to retrieve a string from the SYSIBM.SYSXMLSTRINGS catalog table.

Jane Man is a Senior Software Engineer in DB2 for z/OS Development.
Eric G. Radzinski is a content developer in DB2 for QMF, IBM Analytics.


Please sign in to comment.

Sign In

Join Now!
Future Mainframers

Future Mainframers

To educate those around you to the mainframe, explain its value, answer questions and provide resources.

Read more »

Growing the Mainframe

Growing the Mainframe

The majority of students are unaware of what an IBM System z mainframe is, much less how important the computing platform is to industry and to their daily life. They don’t realize the future employment opportunities for those who pursue an education that includes mainframe topics.

Read more »