Examples of DbParameterAccessor


Examples of org.jtester.module.dbfit.db.model.DbParameterAccessor

          paramName = "";
        String dataType = rs.getString(2);
        // int length=rs.getInt(3);
        String direction = rs.getString(4);
        int paramDirection = getParameterDirection(direction);
        DbParameterAccessor dbp = new DbParameterAccessor(paramName, paramDirection, getSqlType(dataType),
            getJavaClass(dataType), paramDirection == DbParameterAccessor.RETURN_VALUE ? -1 : position++);
        allParams.put(NameNormaliser.normaliseName(paramName), dbp);
      }
      return allParams;
    } finally {
View Full Code Here

Examples of org.jtester.module.dbfit.db.model.DbParameterAccessor

          paramDirection = DbParameterAccessor.RETURN_VALUE;
        } else {
          paramDirection = getParameterDirection(direction);
        }

        DbParameterAccessor dbp = new DbParameterAccessor(paramName, paramDirection, getSqlType(dataType),
            getJavaClass(dataType), paramDirection == DbParameterAccessor.RETURN_VALUE ? -1 : position++);
        allParams.put(NameNormaliser.normaliseName(paramName), dbp);
      }
      return allParams;
    } finally {
View Full Code Here

Examples of org.jtester.module.dbfit.db.model.DbParameterAccessor

      Map<String, DbParameterAccessor> allParams = new HashMap<String, DbParameterAccessor>();
      int position = 0;
      while (rs.next()) {
        String columnName = rs.getString(1);
        String dataType = rs.getString(2);
        DbParameterAccessor dbp = new DbParameterAccessor(columnName, DbParameterAccessor.INPUT,
            typeMapper.getJDBCSQLTypeForDBType(dataType), getJavaClass(dataType), position++);
        allParams.put(NameNormaliser.normaliseName(columnName), dbp);
      }
      return allParams;
    } finally {
View Full Code Here

Examples of org.jtester.module.dbfit.db.model.DbParameterAccessor

      if (accessors[i] == null)
        throw new SQLException("Cannot find parameter for column " + i + " name=\"" + paramName + "\"");
      boolean isOutput = headerCells.text().endsWith("?");
      if (accessors[i].getDirection() == DbParameterAccessor.INPUT_OUTPUT) {
        // clone, separate into input and output
        accessors[i] = new DbParameterAccessor(accessors[i]);
        accessors[i].setDirection(isOutput ? DbParameterAccessor.OUTPUT : DbParameterAccessor.INPUT);
      }
      if (isOutput) {
        columnBindings[i] = new SymbolAccessQueryBinding();
      } else {
        // sql server quirk. if output parameter is used in an input
        // column, then
        // the param should be cloned and remapped to IN/OUT
        if (accessors[i].getDirection() == DbParameterAccessor.OUTPUT) {
          accessors[i] = new DbParameterAccessor(accessors[i]);
          accessors[i].setDirection(DbParameterAccessor.INPUT);
        }
        columnBindings[i] = new SymbolAccessSetBinding();
      }
      columnBindings[i].adapter = accessors[i];
View Full Code Here

Examples of org.jtester.module.dbfit.db.model.DbParameterAccessor

    for (int i = 0; headerCells != null; i++, headerCells = headerCells.more) {
      String name = headerCells.text();
      String paramName = NameNormaliser.normaliseName(name);
      // need to clone db param accessors here because same column may be
      // in the update and select part
      DbParameterAccessor orig = allParams.get(paramName);
      if (orig == null) {
        wrong(headerCells);
        throw new SQLException("Cannot find column " + paramName);
      }
      // clone parameter because there may be multiple usages of the same
      // column
      DbParameterAccessor acc = new DbParameterAccessor(orig);
      acc.setDirection(DbParameterAccessor.INPUT);
      if (headerCells.text().endsWith("="))
        updateAcc.add(acc);
      else
        selectAcc.add(acc);
      columnBindings[i] = new SymbolAccessSetBinding();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.