Examples of Statement


Examples of io.crate.sql.tree.Statement

        assertThat(md.columns().size(), is(2));
        assertThat(md.hasAutoGeneratedPrimaryKey(), is(true));
    }

    private DocIndexMetaData getDocIndexMetaDataFromStatement(String stmt) throws IOException {
        Statement statement = SqlParser.createStatement(stmt);
        ClusterService clusterService = mock(ClusterService.class);
        CreateTableStatementAnalyzer analyzer = new CreateTableStatementAnalyzer(
            new ReferenceInfos(
                ImmutableMap.<String, SchemaInfo>of("doc",
                    new DocSchemaInfo(clusterService,
View Full Code Here

Examples of it.freedomotic.reactions.Statement

        Iterator it = t.getPayload().iterator();
        int row = 0;

        while (it.hasNext()) {
            Statement statement = (Statement) it.next();
            List list = new ArrayList();
            list.add(statement.getLogical());
            list.add(statement.getAttribute());
            list.add(statement.getOperand());
            list.add(statement.getValue());
            model.insertRow(row,
                    list.toArray());
        }
    }
View Full Code Here

Examples of japa.parser.ast.stmt.Statement

        throw new Error("Missing return statement in function");
    }

    final public List Statements() throws ParseException {
        List ret = null;
        Statement stmt;
        label_18: while (true) {
            switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                case ABSTRACT:
                case ASSERT:
                case BOOLEAN:
View Full Code Here

Examples of java.beans.Statement

        MockBean4Owner_Target t = new MockBean4Owner_Target();
        MockBean4Owner_Owner o = new MockBean4Owner_Owner();
        t.setV(o);
        enc.setOwner(o);

        enc.writeStatement(new Statement(o, "loading", new Object[] {}));

        assertCodedXML(t, "/xml/MockBean4Owner_SetOwnerWithWriteStatement.xml",
                temp, enc);

    }
View Full Code Here

Examples of java.sql.Statement

      throw new IOException(sqle.getMessage());
    }

    try {
      // Creating a statement lets us issue commands against the connection.
      Statement s = conn.createStatement();
      // We create the table.
//         s.execute("create cached table JoramDB(name VARCHAR PRIMARY KEY, content VARBINARY(256))");
      /*
      s.execute("CREATE TABLE JoramDB (name VARCHAR(256), content LONG VARCHAR FOR BIT DATA, PRIMARY KEY(name))");
      */
      s.execute("CREATE TABLE JoramDB (name VARCHAR(256), content longblob, primary key(name))"); // MySQL
      s.close();
      conn.commit();
    } catch (SQLException sqle) {
        String exceptionString = sqle.toString();
        if (exceptionString.indexOf("CREATE command denied") == -1)
        {
View Full Code Here

Examples of jmathexpr.util.context.Statement

    }

    public void setActual(String expression) {
        actual = expression;
       
        Statement statement = service.add(expression);
       
        service.execute(statement);
    }   
View Full Code Here

Examples of lombok.ast.Statement

  }
 
  public void checkSwitchStartsWithDefaultOrCase(Switch node) {
    Block body = node.astBody();
    if (body != null) {
      Statement first = body.astContents().first();
      if (first != null && !(first instanceof Case) && !(first instanceof Default)) {
        node.addMessage(error(SWITCH_DOES_NOT_START_WITH_CASE, "switch statements should start with a default or case statement."));
      }
    }
  }
View Full Code Here

Examples of mondrian.server.Statement

      final MDXCompiler compiler = new MDXCompiler(parameters, getLocale());
      final String mdxQuery = compiler.translateAndLookup(rawMdxQuery, parameters);
      // Alternatively, JNDI is possible. Maybe even more ..
      final Query query = connection.parseQuery(mdxQuery);
      final Statement statement = query.getStatement();
      final int queryTimeoutValue = calculateQueryTimeOut(parameters);
      if (queryTimeoutValue > 0)
      {
        statement.setQueryTimeoutMillis(queryTimeoutValue * 1000);
      }

      parametrizeQuery(parameters, query);

      //noinspection deprecation
View Full Code Here

Examples of net.paoding.rose.jade.statement.Statement

        // 调用object的方法
        if (method.getDeclaringClass() == Object.class) {
            return invokeObjectMethod(proxy, method, args);
        }
        // 获取当前DAO方法对应的Statement对象
        Statement statement = getStatement(method);
        //
        // 将参数放入  Map
        Map<String, Object> parameters;
        StatementMetaData statemenetMetaData = statement.getMetaData();
        if (args == null || args.length == 0) {
            parameters = new HashMap<String, Object>(4);
        } else {
            parameters = new HashMap<String, Object>(args.length * 2 + 4);
            for (int i = 0; i < args.length; i++) {
                parameters.put(INDEX_NAMES[i], args[i]);
                SQLParam sqlParam = statemenetMetaData.getSQLParamAt(i);
                if (sqlParam != null) {
                    parameters.put(sqlParam.value(), args[i]);
                }
            }
        }
        // logging
        StringBuilder invocationInfo = null;
        if (debugEnabled) {
            invocationInfo = getInvocationInfo(statemenetMetaData, parameters);
            logger.debug("invoking " + invocationInfo.toString());
        }

        // executing
        long begin = System.currentTimeMillis();
        final Object result = statement.execute(parameters);
        long cost = System.currentTimeMillis() - begin;

        // logging
        if (logger.isInfoEnabled()) {
            if (invocationInfo == null) {
View Full Code Here

Examples of net.rim.device.api.database.Statement

     */
    Category addCategory(final String name) {
        Category category = null;
        try {
            // INSERT a row into the Category table for the new category
            Statement statement =
                    _db.createStatement("INSERT INTO Category VALUES(null, ?)");
            statement.prepare();
            statement.bind(1, name);
            statement.execute();
            statement.close();

            // Query the database for the auto-generated ID of the category just
            // added
            // and create a new Category object.
            statement =
                    _db.createStatement("SELECT category_id FROM Category WHERE category_name = ?");
            statement.prepare();
            statement.bind(1, name);
            final Cursor cursor = statement.getCursor();
            if (cursor.next()) {
                final Row row = cursor.getRow();
                final int id = row.getInteger(0);
                category = new Category(id, name);
            }
            cursor.close();
            statement.close();
        } catch (final DatabaseException dbe) {
            SQLiteDemo.errorDialog(dbe.toString());
        } catch (final DataTypeException dte) {
            SQLiteDemo.errorDialog(dte.toString());
        }
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.