I want to know is it possible to get OUT parameter when invoking a stored mysql procedure using worklight SQL adapter.
For example i have an employee table:-
and stored procedure for above table is:-
and then i query like this:-
It gives the following result :-
Which is working fine.
But when I invoke same procedure using Worklight SQL adapter instead on query browser like: -
WL.Server.invokeSQLStoredProcedure({
procedure : "usp_GetEmployeeName",
parameters : [103,"@name"]
});
it only return me the result set and does not return OUT parameter value.
The ability to call java from the adapters offers a great deal of flexibility, including the ability to call your own JDBC stored proc implementation. Using this we are able to call the stored procs with OUT SYS_REFCURSOR defined and get the result set back as JSON. A jdbc datasource needs to created on your app server (Liberty, Websphere, etc..) See the methods referenced in the StoredProcedure java class to execute the stored proc and get the data back as JSON. Uses Apache dbutils and Jackson for the JSON stuff.
Adapter code:
Java JDBC class:
Nope, the
OUT
parameter is not supported in SQL adapters in Worklight.Same question also answered here: IBM Worklight - Is it possible to call Stored Procedures with the Out parameter?