コード例 #1
0
  /*
   * (non-Javadoc)
   * @see benchmark.testdriver.ServerConnection#executeValidation(benchmark.testdriver.Query, byte, java.lang.String[])
   * Gather information about the result a query returns.
   */
  public QueryResult executeValidation(Query query, byte queryType) {
    String queryString = query.getQueryString();
    String parametrizedQueryString = query.getParametrizedQueryString();
    String encodedParamString = query.getEncodedParamString();
    int queryNr = query.getNr();
    String[] rowNames = query.getRowNames();
    boolean sorted = queryString.toLowerCase().contains("order by");
    QueryResult queryResult = null;
    NetQuery qe;
    if (query.isParametrized)
      qe =
          new NetQuery(
              serverURL, parametrizedQueryString, encodedParamString, queryType, defaultGraph, 0);
    else qe = new NetQuery(serverURL, queryString, "", queryType, defaultGraph, 0);
    InputStream is = qe.exec();
    Document doc = getXMLDocument(is);
    XMLOutputter outputter = new XMLOutputter();
    logResultInfo(query, outputter.outputString(doc));

    if (queryType == Query.SELECT_TYPE)
      queryResult = gatherResultInfoForSelectQuery(queryString, queryNr, sorted, doc, rowNames);

    if (queryResult != null) queryResult.setRun(query.getQueryMix().getRun());
    return queryResult;
  }
コード例 #2
0
 /*
  * Execute Query with Query Object
  */
 public void executeQuery(Query query, byte queryType) {
   if (query.isParametrized)
     executeQuery(
         query.getParametrizedQueryString(),
         query.getEncodedParamString(),
         queryType,
         query.getNr(),
         query.getQueryMix());
   else executeQuery(query.getQueryString(), "", queryType, query.getNr(), query.getQueryMix());
 }