8wDlpd.png
8wDFp9.png
8wDEOx.png
8wDMfH.png
8wDKte.png
Wb.request用法和app.run V8
admin 6月前

Wb.request({
    url: '',
    params: {"a";"cc","dd":"gg"},
    async:false,
    success: function(log_resp) {Wb.decode(log_resp.responseText)} ,
    failure: function(log_resp) {log_resp}
});

 

var text = app.run("{call LMCONFIG.P_TEST_Q({?@-10.resulta?},'qq',{?@O_RETURN_MSG?},{?@O_RETURN_CODE?})}");
var texta = [];
while (text.result.next()) {
  texta.push(text.result.getString('AA'));
}
app.info(texta);

 

 

var statement, connection = DbUtil.getConnection();
    try {
      connection.setAutoCommit(false);
      statement = connection.prepareStatement("insert into 。。。");
      statement.executeUpdate();
      connection.commit();
    } catch (e) {
      Wb.error(e.message);
    } finally {
      DbUtil.close(statement);
      DbUtil.close(connection); //该方法会自动回滚事务(如果未显式提交)并关闭连接
    }

 

var statement,
    connection = DbUtil.getConnection(),
    rs;
  var list = new java.util.ArrayList();
  try {
    connection.setAutoCommit(false);
    statement = connection.prepareStatement("  select t.account_code  ,A.bank_code from。。。");

    rs = statement.executeQuery();
    if (rs !== null) {
      while (rs.next()) {
        var map = new java.util.HashMap();
        map.put("account_code", rs.getString("account_code"));
        map.put("bank_code", rs.getString("bank_code"));
        list.add(map);
      }
    }
    return list;
  } catch (e) {
  } finally {
    DbUtil.close(statement);
    DbUtil.close(connection); //该方法会自动回滚事务(如果未显式提交)并关闭连接
  }

最后于 5月前 被admin编辑 ,原因: 添加app.run
最新回复 (0)
    • 朕弟分享 | 专注小众,乐于分享!
      2
          
返回
发新帖 搜索 反馈 回顶部