This lesson assumes you have completed all preceding lessons. See Lesson 1: Compiling the CustdbScripts Java class with MobiLink references.
UltraLite comes with a sample Windows client that automatically invokes the dbmlsync utility when a user initiates synchronization. In this lesson, you run the application against the CustDB consolidated database you started in the previous lesson. You enter a new customer name and order details. During a subsequent synchronization, this information is uploaded to the CustDB consolidated database and the upload_insert and download_cursor events for the ULCustomer table triggers.
Start the sample application.
Click Start » Programs » SQL Anywhere 12 » UltraLite » Windows Sample Application.
Enter an employee ID and synchronize.
Enter a value of 50 for the employee ID, and click OK.
The application automatically synchronizes and a set of customers, products, and orders are downloaded to the application from the CustDB consolidated database.
Click Order » New.
Enter Frank Javac for a customer name.
Choose a product, and enter the quantity and discount.
Click OK to add the new order.
You have now modified the data in your local UltraLite database. This data is not shared with the consolidated database until you synchronize.
Click File » Synchronize.
A message indicating the insert was successfully uploaded to the consolidated database appears.
Use Interactive SQL to verify that the sample database downloaded new customer data from the sample application.
Connect to the sample database with Interactive SQL.
Click Start » Programs » SQL Anywhere 12 » Administration Tools » Interactive SQL, or run the following command:
Click ODBC Data Source Name and type SQL Anywhere 12 CustDB.
Execute the following SQL statement from Interactive SQL:
SELECT * FROM ULCustomer WHERE cust_name = 'Frank Javac';
The query results appear in the lower pane of Interactive SQL, which displays the customer ID, name, and last modified fields. The last modified field indicates when the customer Frank Javac was last updated. The field should indicate the date and time when you synchronized the sample application with the consolidated database.
Proceed to Cleaning up.
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|