public interface EvalProcItf
class myclass implements EvalProcItf ...
Datahub.addEvalProc("myCommand", new myclass());
String reply = Datahub.sqlReply("eval myCommand arg1 arg2 etc");
System.out.println(reply);
You can test your command using the Datahub SQL command console.
The result of execution is formatted as a two element list to create the
Datahub String reply result.
rc result
Arguments to the command are parsed using list format conventions, not SQL. Therefore, braces { } and double quotes "hello world" are used.
EvalResult is a data structure for execution results, a return code, rc, and a
result string. Datahub return code conventions:
rc == 0 unconditional success
rc > 0 success with a warning or informational result
rc < 0 error, and an error message result
If your procedure throws an SqlException, the datahub uses your return code and exception message for the reply. If you throw any other exception type, the return code of -1 is used.
Modifier and Type | Method and Description |
---|---|
EvalResult |
eval(String procname,
String[] args) |
EvalResult eval(String procname, String[] args) throws SqlException
SqlException