public <T> Enumerable<T> enumerable(Meta.StatementHandle handle, CalcitePrepare.CalciteSignature<T> signature) throws SQLException { Map<String, Object> map = new LinkedHashMap<>(); AvaticaStatement statement = lookupStatement(handle); final List<TypedValue> parameterValues = TROJAN.getParameterValues(statement); if (MetaImpl.checkParameterValueHasNull(parameterValues)) { throw new SQLException("exception while executing query: unbound parameter"); } for (Ord<TypedValue> o : Ord.zip(parameterValues)) { map.put("?" + o.i, o.e.toLocal()); } map.putAll(signature.internalParameters); final AtomicBoolean cancelFlag; try { cancelFlag = getCancelFlag(handle); } catch (NoSuchStatementException e) { throw new RuntimeException(e); } map.put(DataContext.Variable.CANCEL_FLAG.camelName, cancelFlag); final DataContext dataContext = createDataContext(map, signature.rootSchema); return signature.enumerable(dataContext); }
public <T> Enumerable<T> enumerable(Meta.StatementHandle handle, CalcitePrepare.CalciteSignature<T> signature) throws SQLException { Map<String, Object> map = new LinkedHashMap<>(); AvaticaStatement statement = lookupStatement(handle); final List<TypedValue> parameterValues = TROJAN.getParameterValues(statement); if (MetaImpl.checkParameterValueHasNull(parameterValues)) { throw new SQLException("exception while executing query: unbound parameter"); } for (Ord<TypedValue> o : Ord.zip(parameterValues)) { map.put("?" + o.i, o.e.toLocal()); } map.putAll(signature.internalParameters); final AtomicBoolean cancelFlag; try { cancelFlag = getCancelFlag(handle); } catch (NoSuchStatementException e) { throw new RuntimeException(e); } map.put(DataContext.Variable.CANCEL_FLAG.camelName, cancelFlag); final DataContext dataContext = createDataContext(map, signature.rootSchema); return signature.enumerable(dataContext); }
List<TypedValue> parameterValues, long maxRowCount) { try { if (MetaImpl.checkParameterValueHasNull(parameterValues)) { throw new SQLException("exception while executing query: unbound parameter");
@Override public ExecuteResult execute(StatementHandle h, List<TypedValue> parameterValues, int maxRowsInFirstFrame) throws NoSuchStatementException { try { if (MetaImpl.checkParameterValueHasNull(parameterValues)) { throw new SQLException("exception while executing query: unbound parameter");
@Override public ExecuteResult execute(StatementHandle h, List<TypedValue> parameterValues, int maxRowsInFirstFrame) throws NoSuchStatementException { try { if (MetaImpl.checkParameterValueHasNull(parameterValues)) { throw new SQLException("exception while executing query: unbound parameter");