Created
March 21, 2017 23:59
-
-
Save edgars/50ac086e7fafa601e4bffeb416b1076d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @http:GET | |
| @http:Path("/") | |
| resource select(message m) { | |
| sql:Parameter[] params = []; | |
| try { | |
| datatable dt = sql:ClientConnector.select(lcDBConnector, "select empno,ename,job,mgr,hiredate,sal,comm,deptno from emp", params); | |
| json payload = datatables:toJson(dt); | |
| message response = {}; | |
| messages:setJsonPayload(response, payload); | |
| reply response; | |
| } | |
| catch (exception e) { | |
| message response = {}; | |
| messages:setJsonPayload(response, responseException("select", e)); | |
| reply response; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment