@Override
 public List<?> getOutputParameterValues() throws TranslatorException {
   Call proc = (Call) this.command;
   int count = proc.getReturnType() != null ? 1 : 0;
   for (Argument param : proc.getArguments()) {
     if (param.getDirection() == Direction.INOUT || param.getDirection() == Direction.OUT) {
       count++;
     }
   }
   return Arrays.asList(new Object[count]);
 }
  @Override
  public void execute() throws TranslatorException {
    String sourceSQL = (String) this.arguments.get(0).getArgumentValue().getValue();
    List<Argument> parameters = this.arguments.subList(1, this.arguments.size());

    LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Source sql", sourceSQL); // $NON-NLS-1$
    int paramCount = parameters.size();

    try {
      Statement stmt;
      boolean hasResults = false;

      if (paramCount > 0) {
        PreparedStatement pstatement = getPreparedStatement(sourceSQL);
        for (int i = 0; i < paramCount; i++) {
          Argument arg = parameters.get(i);
          // TODO: if ParameterMetadata is supported we could use that type
          this.executionFactory.bindValue(
              pstatement,
              arg.getArgumentValue().getValue(),
              arg.getArgumentValue().getType(),
              i + 1);
        }
        stmt = pstatement;
        hasResults = pstatement.execute();
      } else {
        // TODO: when array support becomes more robust calling like "exec native('sql', ARRAY[])
        // could still be prepared
        stmt = getStatement();
        hasResults = stmt.execute(sourceSQL);
      }

      if (hasResults) {
        this.results = stmt.getResultSet();
        this.columnCount = this.results.getMetaData().getColumnCount();
      } else {
        this.updateCount = stmt.getUpdateCount();
      }
      addStatementWarnings();
    } catch (SQLException e) {
      throw new JDBCExecutionException(JDBCPlugin.Event.TEIID11008, e, sourceSQL);
    }
  }
 @Override
 public ResultSet executeStoredProcedure(
     CallableStatement statement, List<Argument> preparedValues, Class<?> returnType)
     throws SQLException {
   ResultSet rs = super.executeStoredProcedure(statement, preparedValues, returnType);
   if (!oracleSuppliedDriver || rs != null) {
     return rs;
   }
   if (returnType == RefCursorType.class) {
     return (ResultSet) statement.getObject(1);
   }
   for (int i = 0; i < preparedValues.size(); i++) {
     Argument arg = preparedValues.get(i);
     if (arg.getType() == RefCursorType.class) {
       return (ResultSet) statement.getObject(i + (returnType == null ? 1 : 2));
     }
   }
   return null;
 }