Build a DB2 for z/OS Mobile Application
-
Upload
jane-man -
Category
Data & Analytics
-
view
255 -
download
1
Transcript of Build a DB2 for z/OS Mobile Application
Build a DB2 for z/OS Mobile ApplicationJane Man, IBM
Session Code: AP7
Thursday, Sept 17 11:15am – 12:15pm
Platform: DB2 for z/OS
Please note
IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion.
Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision.
The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract. The development, release, and timing of any future features or functionality described for our products remains at our sole discretion.
Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user’s job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.
Agenda
• Mobile Architecture
• System z – the best platform for mobile apps and data
• IBM MobileFirst
• 2 working use cases• Calling a SQL statement
• Calling a stored procedure
• Summary
3
System z information management End-to-End Architecture for Mobile and Cloud Application invoking z Services using APIs
Previously known as : IBM Worklight
Agenda
• Mobile Architecture
• System z – the best platform for mobile apps and data
• IBM MobileFirst
• 2 working use cases• Calling a SQL statement
• Calling a stored procedure
• Summary
5
6
From the complexity of many…
Multiple sets of tools & frameworks Four codebases to develop and maintain
To the simplicity of one
One development environment One codebase to develop and
maintain
IBM Worklight
AndroidApple
Windows
PhoneAndroidApple
Blackberry
Blackberry
IBM MobileFirst Platform – Integrated development and continuous delivery of mobile applications
IBM MobileFirst 7 Studio
• Native applications for• iOS
• Android
• Windows Phone 8
• Windows 8
• Hybrid development
• Server-side development(adapters)• SQL Adapter
• HTTP adapters
• Java adapters
• ……
• Mobile Console Browser
• …much more7
MobileFirst Server
Adapter 1
Adapter 2
….
Enterprise
(back end)
Database
Web services
….
IBM MobileFirst Development Environment
MobileFirst Platform Studio -Eclipse plugin
8
Command line interface (alternative to Studio)
MobileFirst Plaform Developer Studio – Installation
• JRE 7 (Note: Oracle JRE 7 is required for developing Android native app)
• Install Eclipse IDE for Java EE Developers installed: Juno SR2 (4.2.2), Kepler SR1 (4.3.1), Kepler SR2 (4.3.2), Luna SR1 (4.4.1), or Luna SR2 (4.4.2) Third Topic
• Start Eclipse, and then select Help > Eclipse Marketplace.
• In the Find field, type “MobileFirst Platform” and click Go. • In the Find field, type “MobileFirst Platform” and click Go.
• Optional : IBM Dojo Mobile Tools and IBM jQuery Mobile Tools
• JCC driver (DB2 connect)
• (Optional) Android development : Android SDK, ADT Eclipse plug-in, creating Android Virtual Device
(https://developer.ibm.com/mobilefirstplatform/install/#studio)9
Agenda
• Mobile Architecture
• System z – the best platform for mobile apps and data
• IBM MobileFirst
• 2 working use cases• Calling a SQL statement
• Calling a stored procedure
• Summary
10
Use Case 1: SQL statementFind string from string id in SYSIBM.SYSXMLSTRINGS table
11
SELECT STRINGID, SUBSTR(STRING,1,60), IBMREQD
FROM SYSIBM.SYSXMLSTRINGS;
Client development using studio
• Create a new MobileFirst Project: File>New>MobileFirst Project, select “Hybrid Application”
12
index.html
main.js
Sever side Pre-req for SQL adapterAdd DB2 info to server.xml
13
sever.xml
Server Side development – Creating a SQL Adapter
• File>New>MobileFirst Adapter
14
Hello2DB2Adapter.xml
Creating a SQL Adapter – cont’dHello2DB2Adapter-impl.js
• deploy a adapter: Right-Click the adapter>Run As>Deploy MobileFirst Adapter
• Test a adapterRight-Click the adapter>Run As>Call MobileFirst Adapter
Test a SQL Adapter
Right-Click the adapter>Run As>Call MobileFirst Adapter
Result:
What is this?
How to use the adapter result?
main.js
Build all Environments
• Right click <apps>Run As>Build All Environments
• Select iPhone, iPad, Android phones and tablets
18
MobileFirst Console
• Right Click <project> > Open MobileFirst Console
19
MobileFirst Console (cont’d)
20
Run on Android Native Emulator
• (require Android SDK, ADT Eclipse plug-in, creating Android Virtual Device)
• Right Click <project><apps>Android>Run As>Android Application
21
Use Case 2:Calling a Stored Procedure
22
RUNSTATS
RUNSTATS – SQL adapter
23
RunstatsSQLAdapter.xml
RunstatsSQLAdapter-impl.js
Call external REST API – Yahoo Weather API(i.e. SQL Adapter is NOT needed)
24
Main.js
Call external REST API – Yahoo Weather API – cont’d
25
Pitfalls – Oops!
26
Java 8
SELECT
SYSTOOLS.BSON2JSON(DATA)
from JSONPO WHERE ID= 101
SELECT XMLPO from
XMLT1 WHERE ID= 1
SELECT XMLCAST(
XMLQuery('/PO/items/item[1]/productName'
passing XMLPO) as VARCHAR(25))
from XMLT1 WHERE ID= 1
SELECT JSON_VAL(DATA,
'PO.items.item.0.productName', 's:20')
from JSONPO WHERE ID= 101
Agenda
• Mobile Architecture
• System z – the best platform for mobile apps and data
• IBM MobileFirst
• 2 working use cases• Calling a SQL statement
• Calling a stored procedure
• Summary
27
28
28
Summary
DB2 for z/OS is the perfect
environment for developing a
mobile transaction and
analytics integrated solutions
IBM MobileFirst provides an
integrated framework to
develop and test of DB2 for
z/OS mobile applications.
Jane [email protected]
Build a DB2 for z/OS Mobile ApplicationAP7
Please fill out your session
evaluation before leaving!