Start of change

Build a DB2 for z/OS mobile application using IBM MobileFirst Part 1

This is the first part of a three-part series about building an IBM® DB2® for z/OS® mobile application by using IBM MobileFirst™.

About this task

A version of this tutorial was originally published on developerWorks® on 21 September, 2015. The following author contributed to the original version of this tutorial:

  • Jane Man, Senior Software Engineer, IBM

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.

The following figure shows a simplified view of the IBM MobileFirst architecture:

This post is the first of three that 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:

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:
    1. Install Oracle JRE 7 (JRE 8 is not yet supported)
    2. Install the Android SDK.
    3. Install the ADT Eclipse plug-in inside Eclipse:
      1. Click Help > Install New Software.
      2. Click Add, and enter the location: https://dl-ssl.google.com/android/eclipse/
    4. 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.
    5. Add a virtual device (emulator). In Eclipse, click Window > Android Virtual Device Manager. Click Create to create a new Android Virtual Device (AVD). The following shows the AVD that we used.
  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 articles.
    <library
            id="db2jcc">  
             <fileset dir="C:\JCCJars\JCC411" includes="db2jcc4.jar
            db2jcc_license_cisuz.jar"/> 
             </library>   
             <dataSource id="db2" jndiName="dtec222">      
            <jdbcDriver libraryRef="db2jcc"/>      
            <properties.db2.jcc databaseName="STLEC1" password="password1" portNumber="446"
            serverName="hostname1.svl.ibm.com" user="sysadm"/>  
             </dataSource>   
             <dataSource id="db2_serveros" jndiName="zserveros">      
            <jdbcDriver libraryRef="db2jcc"/>      
            <properties.db2.jcc databaseName="EOSDBV11" password="password2" portNumber="5456"
            serverName="hostname2.ibm.com" user="IOD02S"/> 
           </dataSource>

Results

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.

What to do next

Part 2 shows you how to use regular SQL statements to retrieve a string from the SYSIBM.SYSXMLSTRINGS catalog table.

End of change