UpdateJSON.runDDL()

UpdateJSON.runDDL()メソッドは、KVStore.executeSync()を使用してストアに対してDDL文を実行するユーティリティです。

このメソッドは、DDL実行の結果をコマンドラインに書き込むUpdateJSON.displayResult()メソッドに依存しています。これは、この例の後半に示されています。

    // Executes DDL statements (such as are found in defineTable()
    // and createIndex()) in the store.
    private boolean runDDL(KVStore kvstore, String statement) {
        StatementResult result = null;
        boolean success = false;

        try {
            result = kvstore.executeSync(statement);
            displayResult(result, statement);
            success = true;
        } catch (IllegalArgumentException e) {
            System.out.println("Invalid statement:\n" + e.getMessage());
        } catch (FaultException e) {
            System.out.println
                ("Statement couldn't be executed, please retry: " + e);
        }

        return success;
    }