Package org.eigenbase.sql.util

Examples of org.eigenbase.sql.util.SqlBuilder


            4,
            new StringBuffer("New York"));
        doEmpInsert(name, 10);

        // only query what we insert above
        final SqlBuilder buf = new SqlBuilder(SqlDialect.EIGENBASE);
        buf.append(
            "select gender, city, empid from sales.emps where name like ")
            .literal(name + "%");
        String query = buf.getSql();

        preparedStmt = connection.prepareStatement(query);

        resultSet = preparedStmt.executeQuery();
        int empid;
View Full Code Here


                }
                schemas.close();
            }

            tracer.finer("Schema name list has " + list.size() + " entries");
            final SqlBuilder buf = new SqlBuilder(SqlDialect.EIGENBASE);
            for (String name : list) {
                String dropStmt =
                    buf.append("drop schema ")
                        .identifier(name)
                        .append(" cascade")
                        .getSqlAndClear();
                tracer.finer(dropStmt);
                try {
View Full Code Here

            }

            tracer.finer(
                "Datawrapper name list has " + list.size() + " entries");
            Iterator<String> iter = list.iterator();
            final SqlBuilder buf = new SqlBuilder(SqlDialect.EIGENBASE);
            while (iter.hasNext()) {
                String wrapperType = iter.next();
                String name = iter.next();
                String sql =
                    buf.append("drop ")
                        .append(wrapperType)
                        .append(" data wrapper ")
                        .identifier(name)
                        .append(" cascade")
                        .getSqlAndClear();
View Full Code Here

                }
            }

            tracer.finer(
                "Dataserver name list has " + list.size() + " entries");
            final SqlBuilder buf = new SqlBuilder(SqlDialect.EIGENBASE);
            for (String name : list) {
                String sql =
                    buf.append("drop server ")
                        .identifier(name)
                        .append(" cascade")
                        .getSqlAndClear();
                tracer.finer(sql);
                getStmt().execute(sql);
View Full Code Here

                    }
                }
            }

            tracer.finer("Label name list has " + list.size() + " entries");
            final SqlBuilder buf = new SqlBuilder(SqlDialect.EIGENBASE);
            for (String name : list) {
                String sql =
                    buf.append("drop label ")
                        .identifier(name)
                        .append(" cascade")
                        .getSqlAndClear();
                tracer.finer(sql);
                getStmt().execute(sql);
View Full Code Here

            throws Exception
        {
            tracer.fine("Dropping AuthIds.");
            List<String> list = new ArrayList<String>();
            final FarragoRepos repos = getRepos();
            final SqlBuilder buf = new SqlBuilder(SqlDialect.EIGENBASE);
            if (repos != null) {
                for (FemAuthId authId : repos.allOfType(FemAuthId.class)) {
                    if (isBlessedAuthId(authId)) {
                        continue;
                    }
                    list.add(
                        buf.append("drop ")
                            .append(authId instanceof FemRole ? "ROLE" : "USER")
                            .append(" ")
                            .identifier(authId.getName())
                            .getSqlAndClear());
                }
            } else if (stmt != null) {
                if (stmt.execute(
                        "select \"name\",\"mofClassName\" from "
                        + "sys_fem.\"Security\".\"AuthId\""))
                {
                    ResultSet rset = stmt.getResultSet();
                    while (rset.next()) {
                        String name = rset.getString(1);
                        String className = rset.getString(2);
                        if (isBlessedAuthId(name)) {
                            continue;
                        }
                        list.add(
                            buf.append("drop ")
                                .append(className + " " + name)
                                .getSqlAndClear());
                    }
                }
            }
View Full Code Here

        this.tracer = tracer;
    }

    private SqlBuilder createSqlBuilder()
    {
        return new SqlBuilder(SqlDialect.EIGENBASE);
    }
View Full Code Here

    private String generateMedQuery(
        String query,
        String libraryFileName,
        final String mofId)
    {
        final SqlBuilder sqlBuilder = createSqlBuilder();
        sqlBuilder
            .append(
                "select stream name, avalue, description, choices, required "
                + "from table(sys_boot.mgmt.")
            .append(query)
            .append("(")
            .literal(mofId)
            .append(", ")
            .literal(libraryFileName)
            .append(", ")
            .literal("")
            .append(", ")
            .literal("")
            .append(", ")
            .literal("")
            .append(", ")
            .literal(locale.toString())
            .append("))");
        return sqlBuilder.getSql();
    }
View Full Code Here

        String mofId,
        String libraryFileName,
        Map<String, String> wrapperOptions) throws SQLException
    {
        final String methodName = "get_plugin_property_info";
        final SqlBuilder sqlBuilder = createSqlBuilder();
        sqlBuilder
            .append("select * from table(sys_boot.mgmt.")
            .append(methodName)
            .append("(")
            .literal(mofId)
            .append(", ")
            .literal(libraryFileName)
            .append(", ");
        toValues(sqlBuilder, wrapperOptions)
            .append(", ")
            .literal(locale.toString())
            .append("))");
        final String sql = sqlBuilder.getSql();
        return getProperties(methodName, sql);
    }
View Full Code Here

        String libraryFileName,
        Map<String, String> wrapperOptions,
        Map<String, String> serverOptions)
        throws SQLException
    {
        final SqlBuilder selectSqlBuilder = createSqlBuilder();
        final String methodName = "get_server_property_info";
        selectSqlBuilder
            .append("select * from table(sys_boot.mgmt.")
            .append(methodName)
            .append("(")
            .literal(mofId)
            .append(", ")
            .literal(libraryFileName)
            .append(", ");
        toValues(selectSqlBuilder, wrapperOptions)
            .append(", ");
        toValues(selectSqlBuilder, serverOptions)
            .append(", ")
            .literal(locale.toString())
            .append("))");
        final String sql = selectSqlBuilder.getSql();
        return getProperties(methodName, sql);
    }
View Full Code Here

TOP

Related Classes of org.eigenbase.sql.util.SqlBuilder

Copyright © 2018 www.massapicom. 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.