Package org.teiid.translator

Examples of org.teiid.translator.ResultSetExecution


    private List<List> readResultsFromExecution(Execution execution) throws TranslatorException {
      List<List> results = new ArrayList<List>();
      while (true) {
        try {
          if (execution instanceof ResultSetExecution) {
            ResultSetExecution rs = (ResultSetExecution)execution;
            List result = null;
            while ((result = rs.next()) != null) {
              results.add(result);
            }
            break;
          }
          UpdateExecution rs = (UpdateExecution)execution;
          int[] result = rs.getUpdateCounts();
          for (int i = 0; i < result.length; i++) {
            results.add(Arrays.asList(result[i]));
          }
          break;
        } catch (DataNotAvailableException e) {
View Full Code Here


    TestCase.assertEquals(SearchType.Searchable, elementMD2.getSearchType());
    TestCase.assertEquals(true, elementMD2.isAutoIncremented());
    TestCase.assertEquals(false, elementMD2.isCaseSensitive());
   
    TestCase.assertEquals(elementProps2, elementMD2.getProperties());
    ResultSetExecution exec = Mockito.mock(ResultSetExecution.class);
        Mockito.stub(exec.next()).toReturn(null);
        return exec;
 
View Full Code Here

            }
          } 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 {
View Full Code Here

TOP

Related Classes of org.teiid.translator.ResultSetExecution

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.