Exemplo n.º 1
1
  public void bindParams(PreparedStatement ps, EqlRun eqlRun, Logger logger) {
    this.eqlRun = eqlRun;
    boundParams = new StringBuilder();
    this.ps = ps;

    switch (eqlRun.getPlaceHolderType()) {
      case AUTO_SEQ:
        for (int i = 0; i < eqlRun.getPlaceholderNum(); ++i)
          setParam(i, getParamByIndex(i), ParamExtra.Normal);
        break;
      case MANU_SEQ:
        for (int i = 0; i < eqlRun.getPlaceholderNum(); ++i)
          setParam(i, findParamBySeq(i + 1), ParamExtra.Normal);
        break;
      case VAR_NAME:
        for (int i = 0; i < eqlRun.getPlaceholderNum(); ++i)
          setParam(i, findParamByName(i), ParamExtra.Normal);
        break;
      default:
        break;
    }

    bindExtraParams();

    if (boundParams.length() > 0) logger.debug("param: {}", boundParams);
  }
Exemplo n.º 2
0
  private void bindExtraParams() {
    Object[] extraBindParams = eqlRun.getExtraBindParams();
    if (extraBindParams == null) return;

    for (int i = eqlRun.getPlaceholderNum();
        i < eqlRun.getPlaceholderNum() + extraBindParams.length;
        ++i) setParam(i, extraBindParams[i - eqlRun.getPlaceholderNum()], ParamExtra.Extra);
  }