Data Access Techniques

This part presents a collection of techniques you can use to implement data access features in the applications you develop with PowerBuilder. It includes using Transaction objects, XML processing, graphs, rich text, and piping of data between data sources. The use of DataWindow objects and DataStores for data access is described in DataWindow Programmers Guide.

Table of Contents

Using Transaction Objects
About Transaction objects
Description of Transaction object properties
Transaction object properties and supported PowerBuilder database interfaces
Working with Transaction objects
Transaction basics
The default Transaction object
Assigning values to the Transaction object
Reading values from an external file
Connecting to the database
Using the Preview tab to connect in a PowerBuilder application
Disconnecting from the database
Defining Transaction objects for multiple database connections
Error handling after a SQL statement
Pooling database transactions
Using Transaction objects to call stored procedures
Step 1: define the standard class user object
Step 2: declare the stored procedure as an external function
Step 3: save the user object
Step 4: specify the default global variable type for SQLCA
Step 5: code your application to use the user object
Supported DBMS features when calling stored procedures
Using MobiLink Synchronization
About MobiLink synchronization
How the synchronization works
Working with PowerBuilder synchronization objects
Preparing to use the wizard
What gets generated
Creating an instance of MLSync
Auxiliary objects for MobiLink synchronization
Using the synchronization objects in your application
Runtime requirements for synchronization on remote machines
Preparing consolidated databases
Connection events
Table events
Working with scripts and users in SQL Central
Creating remote databases
Creating and modifying publications
Creating MobiLink users
Adding subscriptions
Synchronization techniques
Using PowerBuilder XML Services
About XML and PowerBuilder
About PBDOM
PBDOM object hierarchy
PBDOM node objects
PBDOM_OBJECT
PBDOM_DOCUMENT
PBDOM_DOCTYPE
PBDOM_ELEMENT
PBDOM_ATTRIBUTE
PBDOM_ENTITYREFERENCE
PBDOM_CHARACTERDATA
PBDOM_TEXT
PBDOM_CDATA
PBDOM_COMMENT
PBDOM_PROCESSINGINSTRUCTION
Adding pbdom170.pbx to your application
Using PBDOM
Validating the XML
Creating an XML document from XML
Creating an XML document from scratch
Accessing node data
Manipulating the node-tree hierarchy
Handling PBDOM exceptions
XML namespaces
Setting the name and namespace of a PBDOM_ATTRIBUTE
Manipulating Graphs
Using graphs
Working with graph controls in code
Populating a graph with data
Modifying graph properties
How parts of a graph are represented
Referencing parts of a graph
Accessing data properties
Getting information about the data
Saving graph data
Modifying colors, fill patterns, and other data
Using point and click
Implementing Rich Text
Using rich text in an application
Sources of rich text
Language of rich text
Rich text editors
Deploying a rich text application
Using a RichText DataWindow object
Using a RichTextEdit control
Giving the user control
Text for the control
Using an ActiveX spell checking control
Formatting of rich text
Input fields
Using database data
Cursor position in the RichTextEdit control
Preview and printing
Rich text and the end user
Piping Data Between Data Sources
About data pipelines
Building the objects you need
Building a Pipeline object
Building a supporting user object
Building a window
Performing some initial housekeeping
Starting the pipeline
Monitoring pipeline progress
Canceling pipeline execution
Committing updates to the database
Handling row errors
Repairing error rows
Abandoning error rows
Performing some final housekeeping
Using RESTFul Web Services with JSON
Examples
Example 1 (using RESTClient)
Example 2 (using JSONPackage, HTTPClient, & ImportJson)
Example 3 (using HTTPClient & JSONParser)
Supporting OAuth 2.0 Authorization Server
Examples
Resource Owner Password
Client Credentials Grant
Extension Grant