如何调用存储过程中的工作灯 [英] How To Calling a Stored Procedure in Worklight
问题描述
我刚开始工作在IBM工作灯。我跑了SQL适配器,其中使用的程序,以获取在JSON format.But从数据库和显示数据我想使用该存储过程在我的HTML文件就在我的前端用户界面显示的记录。请给我提供任何建议。
I have just started working on IBM Worklight. I ran a SQL Adapter , in which it uses the procedure to fetch data from database and displays in JSON format.But I want to use that stored procedure in my HTML file regarding to display records in my frontend UI. please provide me any suggestion.
推荐答案
一旦你已经编写并测试适配器,你可以从应用程序使用此语法调用适配器:
Once you have written and tested your adapter you can invoke the adapter from an application using this syntax:
function getData() {
var invocationData = {
adapter : 'ADAPTER_NAME',
procedure : 'PROCEDURE_NAME',
parameters : []
};
WL.Client.invokeProcedure(invocationData,{
onSuccess : getDataSuccess,
onFailure : getDataFailure,
});
}
的onSuccess(当数据被返回给应用程序)调用(在这个例子中)一个称为getDataSuccess函数。此功能将接收来自工作灯服务器返回的JSON数据。
OnSuccess (when the data is returned to the application) calls (in this example) a function called getDataSuccess. This function will receive the JSON data returned from the Worklight server.
onFailure呼叫(在本例中)一个称为getDataFailure功能,将接收从工作灯服务器发送的错误
onFailure calls (in this example) a function called getDataFailure that will receive the error sent from the Worklight server.
有关详细信息,检查<一href="http://public.dhe.ibm.com/ibmdl/export/pub/software/mobile-solutions/worklight/docs/Module_06_-_Invoking_Adapter_Procedures_from_the_Client_Applications.pdf"相对=nofollow>模块6 - 从客户端应用程序调用适配器程序(PDF,370KB)和<一href="http://public.dhe.ibm.com/ibmdl/export/pub/software/mobile-solutions/worklight/docs/module_06_0_EngadgetReader.zip"相对=nofollow>演习和code样品(ZIP,53.7KB)
For more information check module 6 - Invoking Adapter Procedures from the Client Applications (PDF, 370KB) and the exercise and code sample (ZIP, 53.7KB)
这篇关于如何调用存储过程中的工作灯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!