在ibm mobile第一个sql适配器中没有发生插入 [英] Insertion not happening in ibm mobile first sql adapter

查看:135
本文介绍了在ibm mobile第一个sql适配器中没有发生插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将数据从mobilefirst插入到数据库中的现有表中。适配器工作正常,我可以从适配器将数据插入数据库。但是当在客户端调用它时会显示失败消息。

I am trying to insert data into existing table in database from mobilefirst. the adapter is working fine and i can insert data into database from the adapter. But when it is invoked in client side it shows failure message.

function insert(){
    var invocationData = {
              adapter:"sqlad",
                 procedure:"procedure1",
                 parameters:[$('#empid').val(),$('#empname').val()]
            };


    WL.Client.invokeProcedure(invocationData,{
        onSuccess :loadFeedsSuccess,
       onFailure :loadFeedsFailure,
    });
   }

   function loadFeedsSuccess() {

   alert("success");


    }

   function loadFeedsFailure() {
   alert("failure");

   }

html

<body style="display: none;">
            <!--application UI goes here-->
            <h1>ENTER THE EMP DETAILS</h1>
            EMP ID<input type="text" id=empid> <br> <br>
            Emp NAME<input type="text" id=empname><br> <br>
            <input type="submit" value=register onclick="insert();">
            <script src="js/initOptions.js"></script>
            <script src="js/main.js"></script>
            <script src="js/messages.js"></script>
        </body>

adap imp.js

adap imp.js

var procedure1Statement = WL.Server.createSQLStatement("INSERT INTO testdemo(empid,empname) Values(?,?)");
function procedure1(empid,empname) {
    return WL.Server.invokeSQLStatement({
        preparedStatement : procedure1Statement,
        parameters : [empid,empname]
    });
}


推荐答案

这里的实际失败是这个:

The actual failure here is this:


[错误] FWLSE0335E:授权失败:ClientId 8v2iz67uij在服务器上找不到
。 [project simpledb] [错误] FWLSE0048E:未处理的
异常捕获:null
com.worklight.authorization.endpoint.OauthAuthorizationException

[ERROR ] FWLSE0335E: Authorization failed: ClientId 8v2iz67uij was not found on the server. [project simpledb] [ERROR ] FWLSE0048E: Unhandled exception caught: null com.worklight.authorization.endpoint.OauthAuthorizationException

此问题详细说明了解决方案:调用MobileFirst Adapter的授权失败

The solution is detailed in this question: Authorization failure calling MobileFirst Adapter


  1. 要完全解决问题以使其不再出现,您必须将Studio安装更新为最新的iFix。作为IBM客户,您可以使用客户凭证从IBM Fix Central网站下载最新的iFix。

  1. To fully resolve the issue so that it will not appear again, you must update your Studio installation to the latest iFix. As an IBM customer you can download the latest iFix from the IBM Fix Central website using your customer credentials.

作为临时修复,您可以尝试清除浏览器cookies,如链接问题所示。

As a temporary fix you can attempt to clear the browser cookies, as suggested in the linked question.

这篇关于在ibm mobile第一个sql适配器中没有发生插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆