UpdateJSON.runDDL()
The UpdateJSON.runDDL()
method is a utility that executes DDL statements against the store using KVStore.executeSync()
.
This method relies on the UpdateJSON.displayResult() method, which simply writes the results of the DDL execution to the command line. It is shown later in this example.
// 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;
}