Insertion not happening in ibm mobile first sql adapter

China☆狼群 提交于 2019-12-20 07:56:12

问题


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

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

回答1:


The actual failure here is this:

[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

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

  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.

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



来源:https://stackoverflow.com/questions/33099049/insertion-not-happening-in-ibm-mobile-first-sql-adapter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!