Search code examples
db2sqlexceptionibm-mobilefirstmobilefirst-adapters

SQLException while invoking MobileFirst SQLAdapter


I am getting this error:

FWLSE0101E: Caused by: [project ***]com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-313, SQLSTATE=07004, SQLERRMC=null, DRIVER=3.66.46 java.lang.RuntimeException: DB2 SQL Error: SQLCODE=-313, SQLSTATE=07004, SQLERRMC=null, DRIVER=3.66.46. Performed query: update account set regTstamp = (current timestamp) where accountId = ?

while invoking the SQLAdapter.
Here is the invoke procedure:

var AcceptTocInvokeData = {
    adapter : 'DataAdapter',
    procedure : 'updateAcceptTocDate',
    params: [accountId]
};

WL.Client.invokeProcedure(AcceptTocInvokeData, {
    onSuccess: function(resp) {
        deferred.resolve(resp);
    },
    onFailure: function(resp) {
        deferred.reject(resp);
    }
});

and the SQLAdapter code:

var prepStmt = WL.Server.createSQLStatement("update account set regTstamp = (current timestamp) where accountId = ?");

function updateAcceptTocDate(accountId) {       
    return WL.Server.invokeSQLStatement({
        preparedStatement: prepStmt,
        parameters: [accountId]
    });
}

If I call the adapter from MobileFirst Studio (Run as...), it works perfectly. Does anybody know what is going on?


Solution

  • I got the solution on my own:
    I wrote in the invokeData params not parameters.