Submit query to OData service
@throws Exception
773975
public function executeQuery()
    {
        try{
            $request = $this->buildRequest();
            if (is_callable($this->eventsList["BeforeExecuteQuery"])) {
                call_user_func_array($this->eventsList["BeforeExecuteQuery"], array(
                    $request,
                    $this->getCurrentAction()
                ));
            }
            $responseInfo = array();
            $response = $this->executeQueryDirect($request, $responseInfo);
            if ($responseInfo['HttpCode'] >= 400) {
                $error = $this->extractError($response);
                throw new Exception($error['Message']);
            }

            if (!empty($response)) {
                $this->processResponse($response);
            }
            $this->requestStatus = ClientRequestStatus::CompletedSuccess;
        }
        catch(Exception $e){
            $this->requestStatus = ClientRequestStatus::CompletedException;
            throw $e;
        }
    }
500872
public function select( $query, $bindings = [] )
	{
		$query = $this->bind_params( $query, $bindings );

		$result = $this->db->get_results( $query );

		if ( $result === false || $this->db->last_error ) {
			throw new QueryException( $query, $bindings, new \Exception( $this->db->last_error ) );
		}

		return $result;
	}
408585
public function bind_and_run( $query, $bindings = [] )
	{
		$new_query = $this->bind_params( $query, $bindings );

		$result = $this->db->query( $new_query );

		if ( $result === false || $this->db->last_error ) {
			throw new QueryException( $new_query, $bindings, new \Exception( $this->db->last_error ) );
		}

		return (array) $result;
	}
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);
		}
	}
891832
@Override
    public void executeQuery(
            final ObjectClass objClass,
            final Operand query,
            final ResultsHandler handler,
            final OperationOptions options) {

        if (LOG.isOk()) {
            LOG.ok("Execute query: " + query);
        }

        // check objectclass
        if (objClass == null || (!objClass.equals(ObjectClass.ACCOUNT))) {
            throw new IllegalArgumentException("Invalid objectclass");
        }

        // check handler
        if (handler == null) {
            throw new IllegalArgumentException("Invalid handler");
        }

        // get web service client
        final Provisioning provisioning = connection.getProvisioning();
        if (provisioning == null) {
            throw new IllegalStateException("Web Service client not found");
        }

        try {
            final List<WSUser> resultSet = provisioning.query(query);
            if (resultSet == null) {
                return;
            }

            boolean handle = true;
            for (final Iterator<WSUser> i = resultSet.iterator(); i.hasNext() && handle;) {
                final WSUser user = i.next();

                if (LOG.isOk()) {
                    LOG.ok("Found user: {0}", user);
                }

                try {
                    handle = handler.handle(buildConnectorObject(user.getAttributes()).build());
                    LOG.ok("Handle: {0}", handle);
                } catch (Exception e) {
                    LOG.error(e, "Error building connector object for {0}", user);
                }
            }
        } catch (Exception e) {
            throw new IllegalArgumentException(e);
        }
    }
1169771
public JSONArray execute() throws Exception {
        try {
            JSONArray retVal = Client.getInstance(port).map(toString());

            return retVal;
        } catch (Exception e) {
            throw new Exception(queryStringRepresentation + ": " + e.getMessage());
        }
    }
1020915
protected function validate($query)
    {
        if ($this->client->getIndex() == null) {
            throw new SearchException("Index cannot be null");
        }
        if ($this->client->getType() == null) {
            throw new SearchException("Type cannot be null");
        }
        if ($query == null) {
            throw new SearchException("Query can't be null");
        }
    }
1233145
def execute
      response = entity_set.service.execute(self.to_s)
      OData::Query::Result.new(self, response)
    end
216706
public function execute()
    {
        $request = $this->initGraphqlRequest();
        $response = $request->postRaw(
            $this->buildPayload()
        );
        if ($response->getCode() !== 200) {
            throw ExceptionBuilder::fromHttpRequestAndResponse($request, $response);
        }

        return ResultSetBuilder::fromHttpResponse($response);
    }
1075442
public function handleData(QueryHandlerInterface $queryHandler, FilterInterface $filter, $data): void
    {
        if (!$queryHandler instanceof EAVQueryHandlerInterface) {
            throw new BadQueryHandlerException($queryHandler, EAVQueryHandlerInterface::class);
        }
        if (!$queryHandler->isEAVFilter($filter)) {
            $this->fallbackFilterType->handleData($queryHandler, $filter, $data);

            return;
        }
        if ($this->isEmpty($data)) {
            return;
        }

        $eavQb = new EAVQueryBuilder($queryHandler->getQueryBuilder(), $queryHandler->getAlias());
        $eavQb->setContext($queryHandler->getQueryContext());
        $dqlHandlers = [];
        foreach ($filter->getAttributes() as $attributePath) {
            $attributeQb = $queryHandler->getEAVAttributeQueryBuilder($eavQb, $attributePath);
            $dqlHandlers[] = $this->applyAttributeQueryBuilder($attributeQb, $data);
        }

        if (0 < \count($dqlHandlers)) {
            $eavQb->apply($eavQb->getOr($dqlHandlers));
        }
    }
834826
public function query($query) {
    if(method_exists($this->db, 'query')) {
      return $this->db->query($query);
    } else {
      throw new Exception(__METHOD__ . " not implemented");
    }
  }
771570
public void commit() throws Exception {
        final Map<String, Object> params = new HashMap<String, Object>();

        final String applicationId = getPropertyAsString("applicationId");
        if (applicationId != null) params.put("applicationId", applicationId);

        final String name = getName();
        if (name != null) params.put("name", name);

        final String fallbackNumber = getFallbackNumber();
        if (fallbackNumber != null) params.put("fallbackNumber", fallbackNumber);

        final String uri = getUri();
        client.post(uri, params);

        final JSONObject object = toJSONObject(client.get(uri, null));
        updateProperties(object);
    }
815540
public QueryResponse executeQueryPost(Query query) throws ApiException {
        ApiResponse<QueryResponse> resp = executeQueryPostWithHttpInfo(query);
        return resp.getData();
    }
1197018
function query($query,$bind_arr = null){
    $stmt = $this->mysqli->prepare($query);
    if(!$stmt){
     throw new Exception("can't prepare query:[$query] because [".$this->mysqli->error."]");
    }
    if(isset($bind_arr) && $bind_arr != null){
      call_user_func_array(array($stmt,'bind_param'),$this->makeValuesReferenced($bind_arr));
    }
    /* execute prepared statement */
    if(!$stmt->execute()){
       throw new Exception( $this->mysqli->error );
    }
    $answer = $this->fetch($stmt);
    $stmt->close();
    return $answer;
  }
882928
private void executeQuery(
      long index,
      long sequence,
      long timestamp,
      RaftSession session,
      PrimitiveOperation operation,
      CompletableFuture<OperationResult> future) {
    // If the service has been deleted then throw an unknown service exception.
    if (deleted) {
      log.warn("Service {} has been deleted by another process", serviceName);
      future.completeExceptionally(new RaftException.UnknownService("Service " + serviceName + " has been deleted"));
      return;
    }

    // If the session is not open, fail the request.
    if (!session.getState().active()) {
      log.warn("Inactive session: " + session.sessionId());
      future.completeExceptionally(new RaftException.UnknownSession("Unknown session: " + session.sessionId()));
      return;
    }

    // Otherwise, sequence the query.
    sequenceQuery(index, sequence, timestamp, session, operation, future);
  }
1206445
public function commit()
    {
        try {
            $prepared = Agl::app()->getDb()->getConnection()->prepare("
                INSERT INTO
                    `" . $this->getDbPrefix() . $this->_dbContainer . "`
                (" . $this->_getFields() . ")
                VALUES
                (" . $this->_getPreparedFields() . ")
            ");

            if (! $prepared->execute($this->_fields)) {
                $error = $prepared->errorInfo();
                throw new Exception("The insert query failed (table '" . $this->getDbPrefix() . $this->_dbContainer . "') with message '" . $error[2] . "'");
            }

            if (Agl::app()->isDebugMode()) {
                Agl::app()->getDb()->incrementCounter();
            }

            $this->_setId(Agl::app()->getDb()->getConnection()->lastInsertId());

            return $prepared->rowCount();
        } catch (Exception $e) {
            throw new Exception($e);
        }

        return true;
    }
1278554
private InputStream runSparqlQuery(String query) throws IOException {
		try {
			String queryString = "query=" + URLEncoder.encode(query, "UTF-8")
					+ "&format=json";
			URL url = new URL("https://query.wikidata.org/sparql?"
					+ queryString);
			HttpURLConnection connection = (HttpURLConnection) url
					.openConnection();
			connection.setRequestMethod("GET");

			return connection.getInputStream();
		} catch (UnsupportedEncodingException | MalformedURLException e) {
			throw new RuntimeException(e.getMessage(), e);
		}
	}