在 ibm mobile first sql 适配器中没有发生插入
Insertion not happening in ibm mobile first sql adapter
我正在尝试将数据从 mobilefirst 插入数据库中现有的 table。适配器工作正常,我可以将数据从适配器插入数据库。但是当它在客户端调用时它显示失败消息。
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>
适应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]
});
}
这里的实际失败是这样的:
[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
解决方案在这个问题中有详细说明:Authorization failure calling MobileFirst Adapter
要完全解决该问题使其不再出现,您必须将 Studio 安装更新到最新的 iFix。作为 IBM 客户,您可以使用您的客户凭据从 IBM Fix Central 网站下载最新的 iFix。
作为临时修复,您可以按照链接问题中的建议尝试清除浏览器 cookie。
我正在尝试将数据从 mobilefirst 插入数据库中现有的 table。适配器工作正常,我可以将数据从适配器插入数据库。但是当它在客户端调用时它显示失败消息。
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>
适应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]
});
}
这里的实际失败是这样的:
[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
解决方案在这个问题中有详细说明:Authorization failure calling MobileFirst Adapter
要完全解决该问题使其不再出现,您必须将 Studio 安装更新到最新的 iFix。作为 IBM 客户,您可以使用您的客户凭据从 IBM Fix Central 网站下载最新的 iFix。
作为临时修复,您可以按照链接问题中的建议尝试清除浏览器 cookie。