public interface LvalProcItf
class myclass implements LvalProcItf ...
Datahub.addLvalProc("myCommand", new myclass());
String reply = Datahub.sqlReply("lval 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 7 element list to create the Datahub String selection list format result.
Arguments to the command are parsed using list format conventions, not SQL. Therefore, braces { } and double quotes "hello world" are used.
LvalProcResult is a data structure for execution results, with a return code, rc.
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 |
---|---|
LvalProcResult |
lval(String procname,
String[] args) |
LvalProcResult lval(String procname, String[] args) throws SqlException
SqlException