Accessing data in PocketBuilder

When you build an application in PocketBuilder, you can access data in a SQL Anywhere database or UltraLite database in the Database painter and the DataWindow painter. You can also write scripts that access these databases in the Application, Window, Menu, and User Object painters.

NoteProxy tables SQL Anywhere allows you to create proxy tables that can map to other databases, including databases managed by other database management systems. For information on how to create proxy tables, see the SQL Anywhere documentation. For information on identifying identity columns in the underlying database tables referenced by proxy tables, see the technical note “Techniques for Working with Identity Columns in ASA Proxy Tables” on the Sybase Web site.

Connecting to a database

To work in the Database painter or build a DataWindow object in the DataWindow painter, you need to create a database connection profile. This chapter describes how to create and manage database profiles and how to use them to connect to a database in PocketBuilder.

The connection profile has different options depending on which database interface you use. Chapter 14, “Using database interfaces,” describes the database interfaces provided with PocketBuilder.

In scripts, you use Transaction objects to connect to the database. Chapter 16, “Using Transaction Objects,” describes how you connect to a database in a script.

Troubleshooting connections

You can use two tools to trace your database connection in the development environment: the PocketBuilder Database Trace tool and, for ODBC connections, the ODBC Driver Manager Trace tool. Chapter 15, “Troubleshooting Your Connection,” describes how to use the trace tools.

Synchronizing data

For many mobile applications, you do not have a constant network connection, so having access to a local database offline provides a way to have the application work with or without a network connection. You can use SQL Anywhere or UltraLite as the local database and synchronize with your back-end database using MobiLink synchronization technology. MobiLink allows the local database to synchronize directly to many enterprise databases including SQL Anywhere itself, Sybase Adaptive Server® Enterprise, Microsoft SQL Server, IBM DB2, and Oracle.

Chapter 17, “Using MobiLink Synchronization,” provides an overview of MobiLink synchronization and describes how you can launch synchronization from PocketBuilder applications.

Setting parameters and preferences

Chapter 18, “Setting Additional Connection Parameters,” describes how to set database parameters and database preferences in PocketBuilder. Reference information for database parameters and database preferences is in the Connection Reference.