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

SQL Anywhere 12.0.1 » Ultra Light - Java プログラミング » チュートリアル:Android アプリケーションの構築

 

レッスン 4:Android アプリケーションのテストと同期

このレッスンでは、Android アプリケーションを使用して、Ultra Light のリモートデータベースを更新し、CustDB 統合データベースと同期します。

 ♦ Android アプリケーションのテストと同期
  1. [Employee ID] フィールドが 50[Host] フィールドが 10.0.2.2[Port] フィールドが 80 になっていることを確認し、[Save] をクリックします。

    アプリケーションは自動的に同期を実行し、一連の顧客、製品、注文情報が CustDB 統合データベースからアプリケーションにダウンロードされます。

  2. Simulator で [メニュー] » [新規] をクリックします。

  3. [Customer] フィールドで [Ace Properties] を選択します。

  4. [Product] フィールドで [4x8 Drywall x100] を選択します。

  5. [Quantity] フィールドに [999] と入力します。

  6. [Discount] フィールドに [25] と入力します。

  7. [OK] をクリックし、新規注文を追加します。

  8. CustDB 統合データベースとアプリケーションを同期します。

    Simulator で [Menu] をクリックし、[Sync] を選択します。

  9. Interactive SQL を CustDB 統合データベースに接続します。

    1. [スタート] » [プログラム] » [SQL Anywhere 12] » [管理ツール] » [Interactive SQL] をクリックするか、次のコマンドを実行します。

      dbisql
    2. [ODBC データソース名] をクリックし、SQL Anywhere 12 CustDB を選択します。

    3. [接続] をクリックします。

  10. 同期が成功したことを確認します。

    Interactive SQL で次の SQL 文を実行します。

    SELECT order_id, disc, quant, notes, status, c.cust_id, 
        cust_name, p.prod_id, prod_name, price 
      FROM ULOrder o, ULCustomer c, ULProduct p 
      WHERE o.cust_id = c.cust_id 
      AND o.prod_id = p.prod_id 
      AND c.cust_name = 'Ace Properties'
      AND p.prod_name = '4x8 Drywall x100';

    Interactive SQL に注文にエントリが表示されたら、同期が成功しています。

  11. [Simulator ] ウィンドウを閉じます。