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 リファレンス

 

DBConnectionContext インタフェース

構文
public ianywhere.ml.script.DBConnectionContext
備考

現在のデータベース接続に関する情報を取得し、アクセスするためのインタフェース。DBConnectionContext インスタンスは、スクリプトを含むクラスのコンストラクタに渡されます。コンテキストがバックグラウンド・スレッドに必要な場合や、接続期間を超えて必要な場合は、ServerContext クラスを使用してください。

参照
メンバ

ianywhere.ml.script.DBConnectionContext のすべてのメンバ (継承されたメンバも含みます) を以下に示します。

次の例は、同期スクリプトで使用するクラス・レベルの DBConnectionContext インスタンスを作成する方法を示します。DBConnectionContext の getConnection メソッドは、Mobile Link 統合データベースとの現在の接続を表す java.sql.Connection インスタンスを取得します。

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

public class OrderProcessor {
    DBConnectionContext _cc;

    public OrderProcessor(DBConnectionContext cc) {
        _cc = cc;
    }

    // The method used for the handle_DownloadData event.
    public void HandleEvent() throws SQLException {
        java.sql.Connection my_connection = _cc.getConnection();
        // ... 
    }

    // ...
}
警告

DBConnectionContext インスタンスは、Java コードに呼び出すスレッド以外で使用しないでください。


getConnection メソッド
getDownloadData メソッド
getProperties メソッド
getRemoteID メソッド
getServerContext メソッド
getVersion メソッド