Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.1 » MobiLink - Getting Started » MobiLink tutorials » Tutorial: Using Java synchronization logic

 

Lesson 6: Testing synchronization

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 and synchronize the sample application
  1. Start the sample application.

    Click Start » Programs » SQL Anywhere 12 » UltraLite » Windows Sample Application.

  2. 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.

  3. Click Order » New.

  4. Enter Frank Javac for a customer name.

  5. Choose a product, and enter the quantity and discount.

  6. 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.

  7. Click File » Synchronize.

    A message indicating the insert was successfully uploaded to the consolidated database appears.

  8. Use Interactive SQL to verify that the sample database downloaded new customer data from the sample application.

    1. Connect to the sample database with Interactive SQL.

      Click Start » Programs » SQL Anywhere 12 » Administration Tools » Interactive SQL, or run the following command:

      dbisql
    2. Click ODBC Data Source Name and type SQL Anywhere 12 CustDB.

    3. Click Connect.

  9. 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.

  10. Proceed to Cleaning up.

 See also