pocket powerbuilder and database applications. ian thain pocket powerbuilder evangelist ptog...

28
Pocket PowerBuilder And Database Applications

Post on 18-Dec-2015

238 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Pocket PowerBuilder

And Database Applications

Page 2: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Ian Thain Pocket PowerBuilder Evangelist

PTOG Evangelist Team, Sybase Inc.

[email protected]

Page 3: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Agenda

• Introduction• Unwired Enterprise• MobiLink• Developing An Application• Demonstrations

Page 4: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Introduction

• Over the last 11 years we have seen PowerBuilder grow and develop into the tool it is today. Originally for Client Server, then incorporating Component Development & RAD Thin Client Development.

• Also over the last 11 years we have seen increasing developments in DataWindow technology that has seen it appear (or not) as a non-visual DataStore, Java DataWindow and HTML DataWindow

• DataWindows EVERYWHERE? Well nearly!

Page 5: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Introduction

• "Don't think big…Think Small!!"

• Pocket PowerBuilder is now coming to aid corporate development of Pocket PC applications, brining all the benefits

• RAD 4 GL and even the DataWindow technology.

• So we really can now say, DataWindows EVERYWHERE!!!!

Page 6: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Unwired Enterprise

• Liquidity + Mobility = Unwired Enterprise

• Liquidity - Free flowing information with economic value

• Mobility - Freedom to work anytime, anywhere

Page 7: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Enterprise Mobile Applications

• Key areas for a mobile application

• Usability (including intuitiveness, efficiency, ease of use & reliability)

• Innovation (including New Functionality) – maybe from using mobile technologies

• BPI (including extending existing systems) – it should fit well into existing business processes

• ROI – As always a return on investment is a major factor

  

Page 8: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Enterprise Mobile Applications

• Potential Systems for Mobile Applications

• Data Collection• Inventory Management• Customer Relationship Management• Event Tracking• Sales Force Automation• Healthcare

• Field Force Automation• Sales Force Automation• Mobile Healthcare

Page 9: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Mobile Smart Client

• Mobile Smart Client

– Application where client side business logic is executed on device

– Persistent data storage on the device

– Application can be executed at any time, even without a wireless connection

– Integration to the enterprise is typically provided via synchronization

– Client application communicates data to the back end via a synchronization server

Page 10: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Different Functionality

• Synchronization • Pocket PowerBuilder also surpasses

PowerBuilder with the introduction of a MobiLink wizard

• Generates PowerScript code (NVO’s) & Windows for within your application, to interact with a MobiLink Server.

Page 11: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Different Functionality

• Adaptive Server Anywhere mobile database– Uses full data storage capabilities of Adaptive Server Anywhere

on Windows CE client– Database access via ODBC

• MobiLink data synchronization– MobiLink bi-directional data synchronization used to integrate

with other enterprise databases (Sybase ASE and ASA, Oracle, MS SQL Server, IBM DB2)

– New component to manage synchronization properties & maintenance of synchronization

Page 12: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Publication

• A Database Object in the Remote Database data to be synchronized

• Tables can be synchronized– Entirely– Subset of Columns– Subset of Rows– Subset of Columns & Rows

• Define a Publication

• Define a Synchronization User

• Define a Synchronization Subscription

Page 13: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Remote Database

• Located on the mobile device• Can be built with

– Sybase ASA– UltraLite

• Must contain at least one Publication to define which tables will be synchronized

• Must contain at least one Synchronization Subscription to link a Synchronization user with a set of Publications

• Typically a subset of a consolidated database• Data specific or that mobile user

Page 14: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Consolidated Database

• Central / Master DataStore with which the remote synchronizes with

• Can be built with– Sybase ASA– Sybase ASE– Oracle– MS SQL Server– IBM DB2

• Typically an existing Enterprise Database

Page 15: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Consolidated Database

• MobiLink uses system tables in the Consolidated database to store– Synchronization scripts– Synchronization progress & status information– Synchronization User information

• Automatically created in ASA Database• MobiLink Setup scripts for other Consolidated Databases• MobiLink uses ODBC to connect to the Consolidated DB

Page 16: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Synchronization Scripts

• During synchronization MobiLink progresses through a series of events

• Each event can be associated with once synchronization script

• Synchronization scripts– Direct the data flow during the process– Allow tasks to be performed at various points

• Written in the native SQL of the Consolidated Database• Can use versioning

– Remote must specify the version of the scripts to use

Page 17: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

MobiLink Server

• Connects to the Consolidated Database

• Waits for Synchronization requests from Remote DB

• Processes data uploaded from the Remote DB

• Selects data from the Consolidated Database for download to the remote

Page 18: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

dbmlsync

• Synchronization is initiated by a client application via the dbmlsync utility from ASA Remote databases– TCP/IP, SSL– HTTP/HTTPS– ActiveSync

• Read Database engine transaction log• Builds an upstream with the a summary of the changes to

the specific publication since the last synchronization• Applies the downstream from the MobiLink server to the

Remote Database

Page 19: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

MobiLink – ASA Synchronization

ConsolidatedDB

MobiLink

Remote ASADatabase

ODBC

dbmlsync

1. Upload

2. Download

3. Ack Download1. Upload

ASA or UltraLite keep track of all changes since previous synchronization

All changes are sent in a single upload stream MobiLink applies changes in a single transaction

2. Download Scripts in the consolidated database determine

changes that need to be downloaded All changes are sent in a single download stream

3. Acknowledge download Optional

Page 20: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

MobiLink – ASA Synchronization

• Flexible and robust bi-directional synchronization– Support Sybase, Oracle, IBM DB2, Microsoft SQL Server– Synchronization scripts can be written in SQL, Java or any .NET

language• Secure

– Built-in authentication– 128-bit encryption of communication stream

• Support for sub-setting and partitioning of data• Built-in conflict detection and resolution • Scalable to thousands of remote users• Robust error handling

Page 21: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

MobiLink - Quick Start

• Files located in \Samples\MobiLink\Autoscripting• Create and setup consolidated and remote databases

– Use Sybase database creation wizard– Create ODBC datasources– Populate databases with ISQL – Run setup script appropriate for consolidated DB

• Identify tables and columns for synchronization– Add publications, ML Users & subscriptions on Remote DB– Add tables & users for synchronizationn on Consolidated

• Write scripts to upload and download data – Use –za switch on the MobilLink Server – and ‘SendColumnNames=on’ on the MobiLink client – to automatically generate scripts for you

• You are now synchronizing!

Page 22: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Developing an Application

• When developing a Mobile Application always work against the Remote Database

• Best to deploy an empty Remote Database & fill with data on the first Sync.

• Use PPB to generate Synchronization logic in NVO’s

Page 23: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Developing an Application

• DSN on mobile device specifies which ASA Database the app uses– [ODBC]– uid=dba– pwd=sql– enginename=Picture_remote– databasename=Picture_remote– databasefile=\Picture_remote.db– start=\Program Files\Sybase\ASA\dbsrv8.exe –q– driver=dbodbc8.dll

Page 24: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

PPB Application Architecture

ConsolidatedDatabase

(Sybase/Oracle/Microsoft/IBM)

MobiLink

Device

ASA

ML

Enterprise

TCP/IPHTTP

HTTPSActiveSync

(wired or wireless)

SampleApplication)

Pocket PowerBuilder

Virtual Machine

SOAP(Web Services)

App Server

Page 25: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Demonstrations

• Basic Pocket PowerBuilder App– Create a Consolidated DB– Create the Remote DB– Create publications, subsrciptions & users on the remote– Create users & tables for sync on the consolidated– Deploy remote database & dsn– Start Mobilink– Use the wizard to generate an application – Build a DataWindow Object– Place objects on the window– Code PowerScript– Deploy– Run

  

Page 26: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Conclusions

• Pocket PowerBuilder used along with ASA for CE and MobiLink can create very powerful Smart Client Applications

• Data can be synchronized back to the Enterprise Database

Page 27: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Pocket PowerBuilder Code Examples

• Pocket PowerBuilder code examples can be found on the CodeXchange, http://pocketpb.codexchange.sybase.com

Page 28: Pocket PowerBuilder And Database Applications. Ian Thain Pocket PowerBuilder Evangelist PTOG Evangelist Team, Sybase Inc. ian.thain@sybase.com

Questions and

AnswersIan ThainPocket PowerBuilder EvangelistPTOG Evangelist Team, Sybase [email protected]

Check out PBDJ for Pocket PowerBuilder articles