Package com.alibaba.druid.sql.parser

Examples of com.alibaba.druid.sql.parser.SQLSelectParser.select()


        if (lexer.token() == Token.FROM) {
            lexer.nextToken();
            accept(Token.LPAREN);
           
            SQLSelectParser selectParser = createSQLSelectParser();
            SQLSelect select = selectParser.select();

            accept(Token.RPAREN);

            String alias = lexer.stringVal();
            accept(Token.IDENTIFIER);
View Full Code Here


                }
            }
            accept(Token.RPAREN);
        }

        SQLSelect query = selectParser.select();
        insert.setQuery(query);

        return insert;
    }
View Full Code Here

        if (lexer.token() == Token.FROM) {
            lexer.nextToken();
            accept(Token.LPAREN);
           
            SQLSelectParser selectParser = createSQLSelectParser();
            SQLSelect select = selectParser.select();

            accept(Token.RPAREN);

            String alias = lexer.stringVal();
            accept(Token.IDENTIFIER);
View Full Code Here

                }
            }
            accept(Token.RPAREN);
        }

        SQLSelect query = selectParser.select();
        insert.setQuery(query);

        return insert;
    }
View Full Code Here

public class SQLParserTest extends TestCase {

    public void test_select() throws Exception {
        String sql = "   SELECT COUNT(*) FROM close_plan WHERE 1=1          AND close_type = ?             AND target_type = ?             AND target_id = ?         AND(    mi_name=?   )               AND end_time >= ?         ";
        SQLSelectParser parser = new MySqlSelectParser(sql);
        SQLSelect select = parser.select();

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

        select.accept(visitor);
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.