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

SQL Anywhere 11.0.1 (日本語) » Mobile Link - サーバ管理 » Mobile Link サーバ API » Java による同期スクリプトの作成 » Java 用 Mobile Link サーバ API リファレンス » UploadedTableData インタフェース

 

getInserts メソッド

構文
public java.sql.ResultSet getInserts( )
備考

Mobile Link クライアントによってアップロードされた挿入操作を表す java.sql.ResultSet オブジェクトを返します。各挿入は結果セットの 1 つのローで表されています。

戻り値

Mobile Link クライアントによってアップロードされた挿入操作を表す java.sql.ResultSet オブジェクト

参照

リモート・クライアントには remoteOrders というテーブルがあるものとします。次の例は DownloadTableData.getInserts メソッドを使用して、挿入されたローの結果セットを取得します。このコードは、現在のアップロード・トランザクションの各ローに対する発注額を取得します。

import ianywhere.ml.script.*;
import java.sql.*;

// The method used for the handle_UploadData event
public void HandleUpload(UploadData ut)
    throws SQLException, IOException
{
    // Get an UploadedTableData instance representing the remoteOrders table.
    UploadedTableData remoteOrdersTable = ut.getUploadedTableByName("remoteOrders");
 
    // Get inserts uploaded by the MobiLink client.
    java.sql.ResultSet rs = remoteOrdersTable.getInserts();
    while (rs.next()) { 
        // get the uploaded order_amount
        double order_amount = rs.getDouble("order_amount"); 

        // ... 
    }
    rs.close();
}