The following procedure creates a remote database for CustDB. The CustDB remote database must be an UltraLite database.
The application logic for the remote database is located in samples-dir\UltraLite\CustDB. It includes the following files:
Embedded SQL logic The file custdb.sqc contains the SQL statements needed to query and modify information from the UltraLite database, and the calls required to start synchronization with the consolidated database.
C++ API logic The file custdbcomp.cpp contains the C++ API logic.
User-interface features These features are stored separately, in platform-specific subdirectories of Samples\UltraLite\CustDB.
You complete the following steps to install the sample application to a remote device that is running UltraLite:
Start the consolidated database.
Start the MobiLink server.
Install the sample application to your remote device.
Start the sample application on the remote device.
Synchronize the sample application.
The following example installs the CustDB sample on a Palm device running against a DB2 consolidated database.
Ensure that the consolidated database is running:
For a DB2 LUW database, open a DB2 Command Window. Type the following command, where userid and password are the user ID and password for connecting to the DB2 LUW database:
db2 connect to CustDB user userid using password
Start the MobiLink server:
For a DB2 LUW database, at a command prompt, run the following command:
mlsrv11 -c "DSN=CustDB" -zp
Install the sample application to your Palm device:
On your PC, start Palm Desktop.
Click Quick Install on the Palm Desktop toolbar.
Click Add. Browse to custdb.prc in the UltraLite\palm\68k subdirectory of your SQL Anywhere 11 installation.
HotSync your Palm device.
Start the CustDB sample application on your Palm device:
Place your Palm device in its cradle.
When you start the sample application for the first time, you are prompted to synchronize to download an initial copy of the data. This step is required only the first time you start the application. After that, the downloaded data is stored in the UltraLite database.
Launch the sample application.
From the Applications view, tap CustDB.
At the prompt, type an employee ID.
For the purpose of this tutorial, enter a value of 50. The sample application also allows values of 51, 52, or 53, but behaves slightly differently in these cases.
For more information about the behavior of each user ID, see Users in the CustDB sample.
A window tells you that you must synchronize before proceeding.
Synchronize your application.
Use HotSync to obtain an initial copy of the data.
Confirm that the data has been synchronized into the application.
From the Applications view, tap the CustDB application. The display shows an entry sheet for a customer, with entries.
Synchronize the remote application with the consolidated database. You only need to complete this step when you have made changes to the database.
Ensure that the consolidated database and the MobiLink server are running.
Place the Palm device in its cradle.
Press the HotSync button to synchronize.
|Discuss this page in DocCommentXchange.
Send feedback about this page using email.
|Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1|