public SwaggerProcedureExecution(Call command, SwaggerExecutionFactory translator, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection) throws TranslatorException { super(translator, executionContext, metadata, connection); this.command = command; this.expectedColumnTypes = command.getResultSetColumnTypes(); }
public ODataProcedureExecution(Call command, ODataExecutionFactory translator, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection) throws TranslatorException { super(translator, executionContext, metadata, connection); this.command = command; this.expectedColumnTypes = command.getResultSetColumnTypes(); }
public ODataProcedureExecution(Call command, ODataExecutionFactory translator, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection) throws TranslatorException { super(translator, executionContext, metadata, connection); this.visitor = new ODataProcedureVisitor(translator, metadata); this.visitor.visitNode(command); if (!this.visitor.exceptions.isEmpty()) { throw this.visitor.exceptions.get(0); } this.expectedColumnTypes = command.getResultSetColumnTypes(); }
public ProcedureBatchHandler(Call proc, ProcedureExecution procExec) { this.proc = proc; this.procExec = procExec; List<Argument> params = proc.getArguments(); resultSetCols = proc.getResultSetColumnTypes().length; if (proc.getReturnType() != null) { paramCols++; } if(params != null && !params.isEmpty()){ for (Argument param : params) { if(param.getDirection() == Direction.OUT || param.getDirection() == Direction.INOUT){ paramCols += 1; } } } if (paramCols > 0) { filler = Collections.nCopies(paramCols, null); } }
public ProcedureBatchHandler(Call proc, ProcedureExecution procExec) { this.proc = proc; this.procExec = procExec; List<Argument> params = proc.getArguments(); resultSetCols = proc.getResultSetColumnTypes().length; if (proc.getReturnType() != null) { paramCols++; } if(params != null && !params.isEmpty()){ for (Argument param : params) { if(param.getDirection() == Direction.OUT || param.getDirection() == Direction.INOUT){ paramCols += 1; } } } if (paramCols > 0) { filler = Collections.nCopies(paramCols, null); } }
public ProcedureBatchHandler(Call proc, ProcedureExecution procExec) { this.proc = proc; this.procExec = procExec; List<Argument> params = proc.getArguments(); resultSetCols = proc.getResultSetColumnTypes().length; if (proc.getReturnType() != null) { paramCols++; } if(params != null && !params.isEmpty()){ for (Argument param : params) { if(param.getDirection() == Direction.OUT || param.getDirection() == Direction.INOUT){ paramCols += 1; } } } if (paramCols > 0) { filler = Collections.nCopies(paramCols, null); } }
@Override public void execute() throws TranslatorException { Call procedure = (Call)command; columnDataTypes = procedure.getResultSetColumnTypes(); //translate command TranslatedCommand translatedComm = translateCommand(procedure); //create statement or CallableStatement and execute String sql = translatedComm.getSql(); try{ //create parameter index map CallableStatement cstmt = getCallableStatement(sql); this.results = this.executionFactory.executeStoredProcedure(cstmt, translatedComm.getPreparedValues(), procedure.getReturnType()); addStatementWarnings(); }catch(SQLException e){ throw new TranslatorException(JDBCPlugin.Event.TEIID11004, e, JDBCPlugin.Util.gs(JDBCPlugin.Event.TEIID11004, sql)); } }
@Override public void visit(Call call) { if (oracleSuppliedDriver && call.getResultSetColumnTypes().length > 0 && call.getMetadataObject() != null) { if (call.getReturnType() == null && call.getMetadataObject().getProperty(SQLConversionVisitor.TEIID_NATIVE_QUERY, false) == null) { //assume stored function handling if (!setOutCursorType(call)) { call.setReturnType(RefCursorType.class); } } else { //TODO we only will allow a single out cursor if (call.getMetadataObject() != null) { ProcedureParameter param = call.getReturnParameter(); if (param != null && REF_CURSOR.equalsIgnoreCase(param.getNativeType())) { call.setReturnType(RefCursorType.class); } } setOutCursorType(call); } } super.visit(call); }