Examples of parseStatementList()


Examples of com.alibaba.druid.sql.dialect.db2.parser.DB2StatementParser.parseStatementList()

                + "                AND OH.ORDER_ID = ? ) AS TEMP_TAB ) AS TEMP_TAB_WITH_IDX "//
                + " WHERE TEMP_TAB_WITH_IDX.IDX > 0 AND TEMP_TAB_WITH_IDX.IDX <= 20" //
                + "";

        DB2StatementParser parser = new DB2StatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();
        SQLStatement stmt = statementList.get(0);
        print(statementList);

        Assert.assertEquals(1, statementList.size());
View Full Code Here

Examples of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseStatementList()

public class MySqlMockExecuteHandlerImpl implements MockExecuteHandler {

    @Override
    public ResultSet executeQuery(MockStatement statement, String sql) throws SQLException {
        SQLStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> stmtList = parser.parseStatementList(); //

        if (stmtList.size() > 1) {
            throw new SQLException("not support multi-statment. " + sql);
        }
View Full Code Here

Examples of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseStatementList()

        return sql; // 返回原来的SQL
    }
   
    public static String mergeMySql(String sql) {
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();
        SQLStatement statemen = statementList.get(0);

        Assert.isTrue(1 == statementList.size());

        StringBuilder out = new StringBuilder();
View Full Code Here

Examples of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseStatementList()

        }
       
        if(!isWhite) {
            if (text.startsWith("SET")) {
                SQLStatementParser parser = new MySqlStatementParser(text);
                List<SQLStatement> statementList = parser.parseStatementList();
                if (statementList != null && statementList.size() > 0)  {
                    SQLStatement statement = statementList.get(0);
                    if (statement instanceof SQLSetStatement || statement instanceof MySqlSetCharSetStatement
                        || statement instanceof MySqlSetNamesStatement) {
                        isWhite = true;
View Full Code Here

Examples of com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseStatementList()

        return expr;
    }

    public static String formatMySql(String sql) {
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();

        StringBuilder out = new StringBuilder();
        MySqlOutputVisitor visitor = new MySqlOutputVisitor(out);

        for (SQLStatement stmt : statementList) {
View Full Code Here

Examples of com.alibaba.druid.sql.dialect.odps.parser.OdpsStatementParser.parseStatementList()

        String[] items = input.split("---------------------------");
        String sql = items[0].trim();
        String expect = items[1].trim();

        OdpsStatementParser parser = new OdpsStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();
        SQLStatement stmt = statementList.get(0);

        Assert.assertEquals(1, statementList.size());

        SchemaStatVisitor visitor = new OdpsSchemaStatVisitor();
View Full Code Here

Examples of com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser.parseStatementList()

        return out.toString();
    }

    public static String mergeOracle(String sql) {
        OracleStatementParser parser = new OracleStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();
        SQLStatement statemen = statementList.get(0);

        Assert.isTrue(1 == statementList.size());

        StringBuilder out = new StringBuilder();
View Full Code Here

Examples of com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser.parseStatementList()

        return out.toString();
    }

    public static String formatOracle(String sql) {
        OracleStatementParser parser = new OracleStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();

        StringBuilder out = new StringBuilder();

        OracleOutputVisitor visitor;
View Full Code Here

Examples of com.alibaba.druid.sql.dialect.postgresql.parser.PGSQLStatementParser.parseStatementList()

        return sql;
    }

    public static String formatPGSql(String sql) {
        PGSQLStatementParser parser = new PGSQLStatementParser(sql);
        List<SQLStatement> statementList = parser.parseStatementList();

        StringBuilder out = new StringBuilder();
        PGOutputVisitor visitor = new PGOutputVisitor(out);

        for (SQLStatement stmt : statementList) {
View Full Code Here

Examples of com.alibaba.druid.sql.dialect.sqlserver.parser.SQLServerStatementParser.parseStatementList()

        String expect = "SELECT name + ‘ - ’ + master.sys.fn_varbintohexstr(password_hash)\n" + //
                        "FROM master.sys.sql_logins";

        SQLServerStatementParser parser = new SQLServerStatementParser(sql);
        SQLStatement stmt = parser.parseStatementList().get(0);

        String text = TestUtils.outputSqlServer(stmt);

        Assert.assertEquals(expect, text);
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.