{@inheritDoc}

@see jp.co.future.uroborosql.filter.AbstractSqlFilter#doQuery(jp.co.future.uroborosql.context.SqlContext, java.sql.PreparedStatement, java.sql.ResultSet)
436348
@Override
	public ResultSet doQuery(final SqlContext sqlContext, final PreparedStatement preparedStatement,
			final ResultSet resultSet) {
		try {
			if (resultSet.getType() == ResultSet.TYPE_FORWARD_ONLY) {
				LOG.warn("ResultSet type is TYPE_FORWARD_ONLY. DumpResultSqlFilter use ResultSet#beforeFirst(). Please Set TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE.");
			}
			StringBuilder builder = displayResult(resultSet);
			LOG.info(builder.toString());
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return resultSet;
	}
223869
@Override
    public ResultSet executeQuery(String sql) throws SQLException
    {
        checkClosed();
        VoltSQL query = VoltSQL.parseSQL(sql);
        if (!query.isOfType(VoltSQL.TYPE_SELECT)) {
            throw SQLError.get(SQLError.ILLEGAL_STATEMENT, sql);
        }
        return this.executeQuery(query);
    }
894743
@Override
    public DataSet executeQuery(String query) throws JdbcServerException {
        log.info("Received execute query request: " + query);
        Message response = handleMessageAndCheckResponse(JdbcMessage.execute(query));
        return dataSetCreator.createDataSet(response, getMessageType(response));
    }
10581
@Override
	public ResultSet doQuery(final SqlContext sqlContext, final PreparedStatement preparedStatement,
			final ResultSet resultSet) {
		LOG.debug("SQL:{} executed.", sqlContext.getSqlName());
		return resultSet;
	}
50616
private QueryObservable executeQuery(QueryBuilder queryBuilder) {

    // Raw query properties as default
    String sql = queryBuilder.rawStatement;
    Iterable<String> affectedTables = queryBuilder.rawStatementAffectedTables;

    // If SqlFinishedStatement is set then use that one
    if (queryBuilder.statement != null) {

      SqlCompileable.CompileableStatement compileableStatement =
          queryBuilder.statement.asCompileableStatement();

      sql = compileableStatement.sql;
      affectedTables = compileableStatement.tables;
    }

    // Check for auto update
    if (!queryBuilder.autoUpdate || affectedTables == null) {
      affectedTables = Collections.emptySet();
    }

    return db.createQuery(affectedTables, sql, queryBuilder.args);
  }
322769
@When("^I query the database with '(.+?)'$")
    public void selectData(String query) throws Exception {
        Statement myStatement = null;
        //postgres table
        List<String> sqlTable = new ArrayList<String>();
        List<String> sqlTableAux = new ArrayList<String>();
        Connection myConnection = this.commonspec.getConnection();
        java.sql.ResultSet rs = null;
        try {
            myStatement = myConnection.createStatement();
            rs = myStatement.executeQuery(query);
            //column names
            ResultSetMetaData resultSetMetaData = rs.getMetaData();
            int count = resultSetMetaData.getColumnCount();
            for (int i = 1; i <= count; i++) {
                sqlTable.add(resultSetMetaData.getColumnName(i).toString());
            }
            //takes column names and column count
            while (rs.next()) {
                for (int i = 1; i <= count; i++) {
                    //aux list without column names
                    sqlTableAux.add(rs.getObject(i).toString());
                }
            }
            sqlTable.addAll(sqlTableAux);

            //sends raws to environment variable
            for (int i = 0; i < sqlTable.size(); i++) {
                ThreadProperty.set("queryresponse" + i, sqlTable.get(i));
            }
            ThreadProperty.remove("queryresponse" + sqlTable.size());
            rs.close();
            myStatement.close();
        } catch (Exception e) {
            e.printStackTrace();
            Assertions.assertThat(rs).as("There are no response from SELECT").isNotNull();
        }
    }
1230361
public ResultSet executeQuery(String sql) throws SQLException {
    if (executeInternal(sql, fetchSize, Statement.NO_GENERATED_KEYS)) {
      return results.getResultSet();
    }
    return SelectResultSet.createEmptyResultSet();
  }
660768
public Query execute(PageContext pc, SQL sql, Selects selects, int maxrows) throws PageException {
	Column[] orders = selects.getOrderbys();
	Select[] arrSelects = selects.getSelects();

	QueryImpl target = new QueryImpl(new Collection.Key[0], 0, "query", sql);

	for (int i = 0; i < arrSelects.length; i++) {
	    arrSelects[i].getFroms();
	    Column[] froms = arrSelects[i].getFroms();
	    if (froms.length > 1) throw new DatabaseException("can only work with single tables yet", null, sql, null);
	    executeSingle(pc, arrSelects[i], getSingleTable(pc, froms[0]), target, arrSelects.length > 1 ? -1 : maxrows, sql, orders.length > 0);
	}

	// Order By
	if (orders.length > 0) {
	    order(target, orders);
	    if (maxrows > -1) target.cutRowsTo(maxrows);
	}
	// Distinct
	if (selects.isDistinct()) {
	    order(target, selects.getDistincts()); // order to filter
	    // print.e(selects.getDistincts());
	    Key[] _keys = target.getColumnNames();
	    QueryColumn[] columns = new QueryColumn[_keys.length];
	    for (int i = 0; i < columns.length; i++) {
		columns[i] = target.getColumn(_keys[i]);
	    }

	    int i;
	    Object l, r;
	    outer: for (int row = target.getRecordcount(); row > 1; row--) {
		for (i = 0; i < columns.length; i++) {
		    l = columns[i].get(row, null);
		    r = columns[i].get(row - 1, null);
		    if (l == null || r == null) {
			if (l != r) continue outer;
		    }
		    else if (!Operator.equals(l, r, true)) continue outer;
		}
		target.removeRow(row);
	    }
	}
	order(target, orders);

	return target;
    }
1231446
public IResultSet executeQuery() throws OdaException
	{
		String currentQueryText = queryText;
		if(getMaxRows()!=0){
			currentQueryText = currentQueryText+ " LIMIT "+getMaxRows(); 
		}
		try {
			OSQLSynchQuery<ODocument> query = new OSQLSynchQuery<ODocument>(currentQueryText);
			List<ODocument> dbResult = getOrMakeDBResult(db.command(query).execute(parameters));
			/*
			ArrayList<ODocument> unCachedResult = new ArrayList<ODocument>(dbResult.size());
			for (ODocument oDocument : dbResult) {
				ODocument newDoc = new ODocument();
				for (Entry<String, Object> entry : oDocument) {
					newDoc.field(entry.getKey(),entry.getValue());
				}
				unCachedResult.add(newDoc);
			}*/
			return new ResultSet(dbResult,curMetaData);
		} catch (OCommandSQLParsingException e) {
			throw new OdaException(e);
		}
	}
740599
@Override
  public final void executeQuery(final String pQuery) throws Exception {
    try {
      if (getLogger().getIsShowDebugMessagesFor(getClass())
        && getLogger().getDetailLevel() > 30000) {
        getLogger().debug(null, SrvDatabase.class, "try to execute query: "
          + pQuery);
      }
      this.sqliteDatabase.execSQL(pQuery);
    } catch (Exception ex) {
      String msg = ex.getMessage() + ", query:\n" + pQuery;
      ExceptionWithCode ewc = new ExceptionWithCode(SrvDatabase.SQL_EXEC_ERROR,
        msg);
      ewc.setStackTrace(ex.getStackTrace());
      throw ewc;
    }
  }
569573
@NotNull
    public T queryNN() throws SQLException {
        T res = null;
        try (ResultSet r = statement.executeQuery()) {
            if (r.next()) {
                res = resultMapper.map(r);
            }
            Objects.requireNonNull(res);
            return res;
        }
    }
1343325
@Override
    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
565550
protected final <T> T executeQuery(final String sql, final StatementWithReturnBlock<T> queryBlock) throws Exception {
        checkState(initialized);

        setupConnection();
        checkNotNull(connection);
        boolean committed = false;
        try {
            T returnValue = withStatement(connection, sql, queryBlock);
            connection.commit();
            committed = true;
            return returnValue;
        } finally {
            if (!committed) {
                connection.rollback();
                cleanupConnection();
            }
        }
    }
1299339
protected PreparedStatement setObjects(Connection connection, String query,
            Object... objects) throws SQLException {
        PreparedStatement ps = statement(connection, query);
        setObjects(ps, objects);
        return ps;
    }
877774
public T queryForId(DatabaseConnection databaseConnection, ID id, ObjectCache objectCache) throws SQLException {
		if (mappedQueryForId == null) {
			mappedQueryForId = MappedQueryForFieldEq.build(dao, tableInfo, null);
		}
		return mappedQueryForId.execute(databaseConnection, id, objectCache);
	}
629842
protected void executeQueryPrologue(boolean isBatch) throws SQLException {
    executing = true;
    if (closed) {
      throw new SQLException("execute() is called on closed statement");
    }
    protocol.prolog(maxRows, protocol.getProxy() != null, connection, this);
    if (queryTimeout != 0 && (!canUseServerTimeout || isBatch)) {
      setTimerTask(isBatch);
    }
  }
322142
public Query<S> query(Filter<S> filter, FilterValues<S> values, OrderingList<S> ordering)
        throws FetchException
    {
        return query(filter, values, ordering, null);
    }