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

SQL Anywhere 11.0.1 (中文) » MobiLink - 服务器管理 » MobiLink 服务器 API » 使用 Java 语言编写同步脚本 » 用于 Java 的 MobiLink 服务器 API 参考

 

ServerException 类

语法
public ianywhere.ml.script.ServerException
注释

抛出此异常说明出现使服务器上的同步无法进一步执行的错误状况。这将导致 MobiLink 服务器关闭。

成员

ianywhere.ml.script.ServerException 的所有成员,包括所有继承的成员。

示例

以下代码是一个函数,可在发生严重问题时抛出 ServerException,从而致使 MobiLink 服务器关闭。

public void handleUpload(UploadData ud)
    throws SQLException, IOException, ServerException
{

    UploadedTableData tables[] = ud.getUploadedTables();
    if (tables == null) {
        throw new ServerException("Failed to read uploaded tables");
    }

    for (int i = 0; i < tables.length; i++) {
        UploadedTableData currentTable = tables[i];
        println("table " + java.lang.Integer.toString(i)
            + " name: " + currentTable.getName());

        // Print out delete result set.
        println("Deletes");
        printRSInfo(currentTable.getDeletes());

        // Print out insert result set.
        println("Inserts");
        printRSInfo(currentTable.getInserts());

        // print out update result set
        println("Updates");
        printUpdateRSInfo(currentTable.getUpdates());
    }
}

ServerException 构造函数