Examples of StatementContext


Examples of org.apache.derby.iapi.sql.conn.StatementContext

  {
    if (autoCommit)
      throw newSQLException(SQLState.NO_SAVEPOINT_WHEN_AUTO);

    //Bug 4507 - savepoint not allowed inside trigger
    StatementContext stmtCtxt = getLanguageConnection().getStatementContext();
    if (stmtCtxt!= null && stmtCtxt.inTrigger())
      throw newSQLException(SQLState.NO_SAVEPOINT_IN_TRIGGER);
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.conn.StatementContext

    if ((conn == null) || conn.isClosed())
      throw Util.noCurrentConnection();

    if (!internal) {
      StatementContext sc = conn.getLanguageConnection().getStatementContext();
      if ((sc == null) || (sc.getSQLAllowed() < org.apache.derby.catalog.types.RoutineAliasInfo.MODIFIES_SQL_DATA))
        throw Util.noCurrentConnection();
    }

    return conn.getLocalDriver().getNewNestedConnection(conn);
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.conn.StatementContext

     * LanguageConnectionContext.
     */
    beginTime = getCurrentTimeMillis();
    beginExecutionTime = beginTime;

    StatementContext sc = lcc.getStatementContext();
    sc.setTopResultSet(this, (NoPutResultSet[]) null);

    // Pick up any materialized subqueries
    if (subqueryTrackingArray == null)
    {
      subqueryTrackingArray = sc.getSubqueryTrackingArray();
    }
  }
View Full Code Here

Examples of org.apache.phoenix.compile.StatementContext

                new SingleKeyValueTuple(new KeyValue(B, SINGLE_COLUMN_FAMILY, SINGLE_COLUMN, PDataType.LONG.toBytes(2L))),
            };

        PhoenixConnection pconn = DriverManager.getConnection(getUrl(), PropertiesUtil.deepCopy(TEST_PROPERTIES)).unwrap(PhoenixConnection.class);
        PhoenixStatement statement = new PhoenixStatement(pconn);
        StatementContext context = new StatementContext(statement, null, new Scan(), new SequenceManager(statement));
        AggregationManager aggregationManager = context.getAggregationManager();
        SumAggregateFunction func = new SumAggregateFunction(Arrays.<Expression>asList(new KeyValueColumnExpression(new PLongColumn() {
            @Override
            public PName getName() {
                return SINGLE_COLUMN_NAME;
            }
View Full Code Here

Examples of org.jboss.mbui.gui.behaviour.StatementContext

        private void addStep(InteractionUnit interactionUnit)
        {
            InteractionCoordinator coordinator = context.get(ContextKey.COORDINATOR);

            final StatementContext delegate = coordinator.getStatementScope().getContext(interactionUnit.getId());
            assert delegate != null : "StatementContext not provided";

            DMRMapping mapping = (DMRMapping) interactionUnit.findMapping(DMR, new Predicate<DMRMapping>()
            {
                @Override
                public boolean appliesTo(final DMRMapping candidate)
                {
                    // the read-resource operation only needs the address of a resource
                    // hence we can skip mapping without address declarations (i.e. just attributes)
                    return candidate.getAddress() != null;
                }
            });
            if (mapping != null)
            {
                String address = mapping.getAddress();
                if (!resolvedAdresses.contains(address))
                {
                    AddressMapping addressMapping = AddressMapping.fromString(address);
                    ModelNode op = addressMapping.asResource(new DelegatingStatementContext()
                    {
                        @Override
                        public String resolve(String key)
                        {
                            // fallback strategy for values that are created at runtime, i.e. datasource={selected.entity}
                            String resolved = delegate.resolve(key);
                            if (null == resolved) { resolved = "*"; }
                            return resolved;
                        }

                        @Override
                        public String[] resolveTuple(String key)
                        {
                            return delegate.resolveTuple(key);
                        }

                        @Override
                        public LinkedList<String> collect(String key) {
                            LinkedList<String> items = new LinkedList<String>();
View Full Code Here

Examples of org.skife.jdbi.v2.StatementContext

    @Test
    public void updatesTimerForSqlObjects() throws Exception {
        final StatementNameStrategy strategy = new SmartNameStrategy();
        final InstrumentedTimingCollector collector = new InstrumentedTimingCollector(registry,
                                                                                      strategy);
        final StatementContext ctx = mock(StatementContext.class);
        doReturn("SELECT 1").when(ctx).getRawSql();
        doReturn(getClass()).when(ctx).getSqlObjectType();
        doReturn(getClass().getMethod("updatesTimerForSqlObjects")).when(ctx).getSqlObjectMethod();

        collector.collect(TimeUnit.SECONDS.toNanos(1), ctx);
View Full Code Here

Examples of org.skife.jdbi.v2.StatementContext

    @Test
    public void updatesTimerForSqlObjectsWithoutMethod() throws Exception {
        final StatementNameStrategy strategy = new SmartNameStrategy();
        final InstrumentedTimingCollector collector = new InstrumentedTimingCollector(registry,
                                                                                      strategy);
        final StatementContext ctx = mock(StatementContext.class);
        doReturn("SELECT 1").when(ctx).getRawSql();
        doReturn(getClass()).when(ctx).getSqlObjectType();

        collector.collect(TimeUnit.SECONDS.toNanos(1), ctx);
View Full Code Here

Examples of org.skife.jdbi.v2.StatementContext

    @Test
    public void updatesTimerForRawSql() throws Exception {
        final StatementNameStrategy strategy = new SmartNameStrategy();
        final InstrumentedTimingCollector collector = new InstrumentedTimingCollector(registry,
                                                                                      strategy);
        final StatementContext ctx = mock(StatementContext.class);
        doReturn("SELECT 1").when(ctx).getRawSql();

        collector.collect(TimeUnit.SECONDS.toNanos(2), ctx);

        final String name = strategy.getStatementName(ctx);
View Full Code Here

Examples of org.skife.jdbi.v2.StatementContext

    @Test
    public void updatesTimerForNoRawSql() throws Exception {
        final StatementNameStrategy strategy = new SmartNameStrategy();
        final InstrumentedTimingCollector collector = new InstrumentedTimingCollector(registry,
                                                                                      strategy);
        final StatementContext ctx = mock(StatementContext.class);

        collector.collect(TimeUnit.SECONDS.toNanos(2), ctx);

        final String name = strategy.getStatementName(ctx);
        final Timer timer = registry.timer(name);
View Full Code Here

Examples of org.skife.jdbi.v2.StatementContext

    @Test
    public void updatesTimerForNonSqlishRawSql() throws Exception {
        final StatementNameStrategy strategy = new SmartNameStrategy();
        final InstrumentedTimingCollector collector = new InstrumentedTimingCollector(registry,
                                                                                      strategy);
        final StatementContext ctx = mock(StatementContext.class);
        doReturn("don't know what it is but it's not SQL").when(ctx).getRawSql();

        collector.collect(TimeUnit.SECONDS.toNanos(3), ctx);

        final String name = strategy.getStatementName(ctx);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.