Package org.teiid.translator

Examples of org.teiid.translator.Execution


    }

    private List executeCommand(Command command, RuntimeMetadata runtimeMetadata, boolean close)
        throws TranslatorException {

        Execution exec = connector.createExecution(command, this.executionContext, runtimeMetadata, this.connectionFactory);
        exec.execute();
        List results = readResultsFromExecution(exec);
        if (close) {
          exec.close();
        }
        return results;
    }
View Full Code Here


          this.translatedCommand = factory.translate(command);
 
          RuntimeMetadata rmd = new RuntimeMetadataImpl(queryMetadata);
         
          // Create the execution based on mode
          final Execution exec = connector.createExecution(this.translatedCommand, this.securityContext, rmd, (unwrapped == null) ? this.connection:unwrapped);
          if (this.translatedCommand instanceof Call) {
            this.execution = Assertion.isInstanceOf(exec, ProcedureExecution.class, "Call Executions are expected to be ProcedureExecutions"); //$NON-NLS-1$
            StoredProcedure proc = (StoredProcedure)command;
            if (proc.returnParameters()) {
              this.procedureBatchHandler = new ProcedureBatchHandler((Call)this.translatedCommand, (ProcedureExecution)exec);
            }
          } else if (this.translatedCommand instanceof QueryExpression){
            this.execution = Assertion.isInstanceOf(exec, ResultSetExecution.class, "QueryExpression Executions are expected to be ResultSetExecutions"); //$NON-NLS-1$
          } else {
            Assertion.isInstanceOf(exec, UpdateExecution.class, "Update Executions are expected to be UpdateExecutions"); //$NON-NLS-1$
            this.execution = new ResultSetExecution() {
              private int[] results;
              private int index;
             
              @Override
              public void cancel() throws TranslatorException {
                exec.cancel();
              }
              @Override
              public void close() {
                exec.close();
              }
              @Override
              public void execute() throws TranslatorException {
                exec.execute();
              }
              @Override
              public List<?> next() throws TranslatorException,
                  DataNotAvailableException {
                if (results == null) {
View Full Code Here

TOP

Related Classes of org.teiid.translator.Execution

Copyright © 2018 www.massapicom. 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.