Call the onQueryExecuteTimeLimitExceeded hook if necessary
@param sql sql statement that took too long
@param queryStartTime time when query was started.
544380
protected void queryTimerEnd(String sql, long queryStartTime) {
		if ((this.queryExecuteTimeLimit != 0) 
				&& (this.connectionHook != null)){
			long timeElapsed = (System.nanoTime() - queryStartTime);
			
			if (timeElapsed > this.queryExecuteTimeLimit){
				this.connectionHook.onQueryExecuteTimeLimitExceeded(this.connectionHandle, this, sql, this.logParams, timeElapsed);
			}
		}
		
		if (this.statisticsEnabled){
			this.statistics.incrementStatementsExecuted();
			this.statistics.addStatementExecuteTime(System.nanoTime() - queryStartTime);
			
		}

	}
204539
public ResultSetFuture executeAsync(@NotNull String keyspace, @NotNull String query) {
        Timer time = getMetricsFactory().getTimer(MetricsType.CASSANDRA_EXECUTE_ASYNC.name());

        getMetricsFactory().getCounter(MetricsType.CASSANDRA_PROCESSING_QUERIES.name()).inc();

        ResultSetFuture resultSetFuture = getOrCreateSession(keyspace).executeAsync(query);

        Futures.addCallback(resultSetFuture, new StatementExecutionCallback(keyspace, query));

        monitorFuture(time, resultSetFuture);

        return resultSetFuture;
    }
794396
public void setStartTime(com.google.api.ads.admanager.axis.v201811.DateTime startTime) {
        this.startTime = startTime;
    }
1351485
@Override
    public int doStartTag() throws JspException {

        if (!maxRowsSpecified) {
	    Object obj = Config.find(pageContext, Config.SQL_MAX_ROWS);
	    if (obj != null) {
		if (obj instanceof Integer) {
		    maxRows = ((Integer) obj).intValue();
		} else if (obj instanceof String) {
		    try {
			maxRows = Integer.parseInt((String) obj);
		    } catch (NumberFormatException nfe) {
                        throw new JspException(Resources.getMessage("SQL_MAXROWS_PARSE_ERROR",
						 (String) obj),
			    nfe);
		    }
		} else {
                    throw new JspException(Resources.getMessage("SQL_MAXROWS_INVALID"));
		}
            }
        }

	try {
	    conn = getConnection();
	} catch (SQLException e) {
	    throw new JspException(sql + ": " + e.getMessage(), e);
	}

	return EVAL_BODY_BUFFERED;
    }
667566
function sendRequestPreExec(statementContext, onResultAvailable)
{
  // get the request headers
  var headers = statementContext.resultRequestHeaders;

  // build the basic json for the request
  var json =
  {
    disableOfflineChunks : false,
    sqlText              : statementContext.sqlText
  };

  // if binds are specified, build a binds map and include it in the request
  if (Util.exists(statementContext.binds))
  {
    json.bindings = buildBindsMap(statementContext.binds);
  }

  // include statement parameters if a value was specified
  if (Util.exists(statementContext.parameters))
  {
    json.parameters = statementContext.parameters;
  }

  // include the internal flag if a value was specified
  if (Util.exists(statementContext.internal))
  {
    json.isInternal = statementContext.internal;
  }

  // use the snowflake service to issue the request
  sendSfRequest(statementContext,
  {
    method  : 'POST',
    headers : headers,
    url     : Url.format(
    {
      pathname : '/queries/v1/query-request',
      search   : QueryString.stringify(
      {
        requestId: statementContext.requestId
      })
    }),
    json: json,
    callback: buildResultRequestCallback(
        statementContext, headers, onResultAvailable)
  },
  true);
}
1006181
public void updateQuery(QueryControllerQuery query) {
		int position = getElementPosition(query.getID());
		queries.set(position, query);
	}
1172207
public long queryForCountStar(DatabaseConnection databaseConnection) throws SQLException {
		if (countStarQuery == null) {
			StringBuilder sb = new StringBuilder(64);
			sb.append("SELECT COUNT(*) FROM ");
			databaseType.appendEscapedEntityName(sb, tableInfo.getTableName());
			countStarQuery = sb.toString();
		}
		long count = databaseConnection.queryForLong(countStarQuery);
		logger.debug("query of '{}' returned {}", countStarQuery, count);
		return count;
	}
859082
public void handleQueryMessage(final long senderHSId, long requestId, long gapStart) {
            m_es.execute(new Runnable() {
                @Override
                public void run() {
                    long lastSeq = Long.MIN_VALUE;
                    Pair<Long, Long> range = m_gapTracker.getRangeContaining(gapStart);
                    if (range != null) {
                        lastSeq = range.getSecond();
                    }
                    sendQueryResponse(senderHSId, requestId, lastSeq);
                }
            });
    }
1159301
@Override
    public final void pagedExecute(String queryId, LogicalWorkflow workflow, IResultHandler resultHandler,
                                   int pageSize) throws ConnectorException {
        Long time = null;
        try {
            for (LogicalStep project : workflow.getInitialSteps()) {
                ClusterName clusterName = ((Project) project).getClusterName();
                connectionHandler.startJob(clusterName.getName());
            }
            if (logger.isDebugEnabled()) {
                logger.debug("Async paged Executing [" + workflow.toString() + "] : queryId [" + queryId + "]");
            }
            time = System.currentTimeMillis();
            pagedExecuteWorkFlow(queryId, workflow, resultHandler, pageSize);

            if (logger.isDebugEnabled()) {
                logger.debug(
                        "The async query [" + queryId + "] has ended");
            }
        } finally {
            for (LogicalStep project : workflow.getInitialSteps()) {
                connectionHandler.endJob(((Project) project).getClusterName().getName());
            }
            if (time != null) {
                logger.info("TIME - The execute time to paged executed with queryId [" + queryId + "] has been [" + (System
                        .currentTimeMillis() - time)
                        + "]");
            }
        }

    }
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);
    }
  }
355286
@Override
    public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
        if (DBG) Log.d(LOG_TAG, "runQueryOnBackgroundThread(" + constraint + ")");
        String query = (constraint == null) ? "" : constraint.toString();
        /**
         * for in app search we show the progress spinner until the cursor is returned with
         * the results.
         */
        Cursor cursor = null;
        if (mSearchView.getVisibility() != View.VISIBLE
                || mSearchView.getWindowVisibility() != View.VISIBLE) {
            return null;
        }
        //mSearchView.getWindow().getDecorView().post(mStartSpinnerRunnable); // TODO:
        try {
            cursor = getSuggestions(query, QUERY_LIMIT);
            // trigger fill window so the spinner stays up until the results are copied over and
            // closer to being ready
            if (cursor != null) {
                cursor.getCount();
                return cursor;
            }
        } catch (RuntimeException e) {
            Log.w(LOG_TAG, "Search suggestions query threw an exception.", e);
        }
        // If cursor is null or an exception was thrown, stop the spinner and return null.
        // changeCursor doesn't get called if cursor is null
        // mSearchView.getWindow().getDecorView().post(mStopSpinnerRunnable); // TODO:
        return null;
    }
985863
void performPostExecute() throws SQLException {

        resultOut.clearLobResults();

        generatedResult = null;

        if (resultIn == null) {
            return;
        }

        Result current = resultIn;

        while (current.getChainedResult() != null) {
            current = current.getUnlinkChainedResult();

            if (current.getType() == ResultConstants.WARNING) {
                SQLWarning w = Util.sqlWarning(current);

                if (rootWarning == null) {
                    rootWarning = w;
                } else {
                    rootWarning.setNextWarning(w);
                }
            } else if (current.getType() == ResultConstants.ERROR) {
                errorResult = current;
            } else if (current.getType() == ResultConstants.DATA) {
                generatedResult = current;
            }
        }

        if (resultIn.isData()) {
            currentResultSet = new JDBCResultSet(connection.sessionProxy,
                    this, resultIn, resultIn.metaData,
                    connection.connProperties);
        }
    }
1320466
@Override
    public Cursor onQuery(T helper, SQLiteDatabase db, MatcherPattern target, QueryParameters parameter) {
        Cursor result = null;

        SQLiteQueryBuilder builder = new SQLiteQueryBuilder();
        builder.setTables(target.getTableInfo().getName());
        builder.setProjectionMap(target.getTableInfo().getProjectionMap());

        // where
        switch (target.getMimeTypeVnd().getSubType()) {

            case ITEM:
                // Add item selection criteria (using StringBuilder via appendWhere)
                // URI parameter type not set at this level of the class hierarchy, but it is
                // assumed to be numeric so value not escaped.
                builder.appendWhere(target.getTableInfo().getIdColumnInfo().getColumnName());
                builder.appendWhere("=");
                builder.appendWhere(parameter.getUri().getPathSegments().get(1));
                break;

            case DIRECTORY:
            default:
                break;
        }

        // orderBy
        String orderBy = getSortOrderStringForQuery(target, parameter);

        result = builder.query(db, parameter.getProjection(), parameter.getSelection(), parameter.getSelectionArgs(),
            null, null, orderBy);
        return result;
    }
694467
public boolean execute(final String query) throws SQLException {
        startTimer();
        try {
            if (queryResult != null) {
                queryResult.close();
            }
            queryResult = protocol.executeQuery(queryFactory.createQuery(query));
            if (queryResult.getResultSetType() == ResultSetType.SELECT) {
                setResultSet(new DrizzleResultSet(queryResult, this, getProtocol()));
                return true;
            }
            setUpdateCount(((ModifyQueryResult) queryResult).getUpdateCount());
            return false;
        } catch (QueryException e) {
            throw SQLExceptionMapper.get(e);
        } finally {
            stopTimer();
        }
    }
725475
public static void sqlminute(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    singleArgumentFunctionCall(buf, "extract(minute from ", "minute", parsedArgs);
  }
971045
public void executeQueryAsync(String query, CallbackHandler callbackHandler) throws FMSException {
        IntuitMessage intuitMessage = prepareQuery(query);

        //set callback handler
        intuitMessage.getRequestElements().setCallbackHandler(callbackHandler);

        //execute async interceptors
        executeAsyncInterceptors(intuitMessage);
    }
1228589
public final void setGuaranteedValueStartTick(long value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setGuaranteedValueStartTick", Long.valueOf(value));
        getHdr2().setLongField(JsHdr2Access.GUARANTEEDVALUE_SET_STARTTICK, value);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setGuaranteedValueStartTick");
    }