Package com.alibaba.druid.sql.dialect.oracle.ast.stmt

Examples of com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleGrantStatement


        return stmt;
    }

    public SQLStatement parseGrant() {
        accept(Token.GRANT);
        OracleGrantStatement stmt = new OracleGrantStatement();

        for (;;) {
            if (lexer.token() == Token.ALL) {
                lexer.nextToken();
                if (identifierEquals("PRIVILEGES")) {
                    lexer.nextToken();
                }
                stmt.getPrivileges().add("ALL");
            } else if (lexer.token() == Token.SELECT) {
                stmt.getPrivileges().add("SELECT");
                lexer.nextToken();
            } else if (lexer.token() == Token.UPDATE) {
                stmt.getPrivileges().add("UPDATE");
                lexer.nextToken();
            } else if (lexer.token() == Token.DELETE) {
                stmt.getPrivileges().add("DELETE");
                lexer.nextToken();
            } else if (lexer.token() == Token.INSERT) {
                stmt.getPrivileges().add("INSERT");
                lexer.nextToken();
            } else if (lexer.token() == Token.CREATE) {
                lexer.nextToken();

                if (lexer.token() == Token.TABLE) {
                    stmt.getPrivileges().add("CREATE TABLE");
                    lexer.nextToken();
                } else if (identifierEquals("SYNONYM")) {
                    stmt.getPrivileges().add("CREATE SYNONYM");
                    lexer.nextToken();
                } else {
                    throw new ParserException("TODO : " + lexer.token() + " " + lexer.stringVal());
                }
            }

            if (lexer.token() == Token.COMMA) {
                lexer.nextToken();
                continue;
            }
            break;
        }

        if (lexer.token() == Token.ON) {
            lexer.nextToken();
            stmt.setOn(this.exprParser.expr());
        }

        return stmt;
    }
View Full Code Here


        return stmt;
    }

    public SQLStatement parseGrant() {
        accept(Token.GRANT);
        OracleGrantStatement stmt = new OracleGrantStatement();

        for (;;) {
            if (lexer.token() == Token.ALL) {
                lexer.nextToken();
                if (identifierEquals("PRIVILEGES")) {
                    lexer.nextToken();
                }
                stmt.getPrivileges().add("ALL");
            } else if (lexer.token() == Token.SELECT) {
                stmt.getPrivileges().add("SELECT");
                lexer.nextToken();
            } else if (lexer.token() == Token.UPDATE) {
                stmt.getPrivileges().add("UPDATE");
                lexer.nextToken();
            } else if (lexer.token() == Token.DELETE) {
                stmt.getPrivileges().add("DELETE");
                lexer.nextToken();
            } else if (lexer.token() == Token.INSERT) {
                stmt.getPrivileges().add("INSERT");
                lexer.nextToken();
            } else if (lexer.token() == Token.CREATE) {
                lexer.nextToken();

                if (lexer.token() == Token.TABLE) {
                    stmt.getPrivileges().add("CREATE TABLE");
                    lexer.nextToken();
                } else if (identifierEquals("SYNONYM")) {
                    stmt.getPrivileges().add("CREATE SYNONYM");
                    lexer.nextToken();
                } else {
                    throw new ParserException("TODO : " + lexer.token() + " " + lexer.stringVal());
                }
            }

            if (lexer.token() == Token.COMMA) {
                lexer.nextToken();
                continue;
            }
            break;
        }

        if (lexer.token() == Token.ON) {
            lexer.nextToken();
            stmt.setOn(this.exprParser.expr());
        }

        return stmt;
    }
View Full Code Here

        return stmt;
    }

    public SQLStatement parseGrant() {
        accept(Token.GRANT);
        OracleGrantStatement stmt = new OracleGrantStatement();

        for (;;) {
            if (lexer.token() == Token.ALL) {
                lexer.nextToken();
                if (identifierEquals("PRIVILEGES")) {
                    lexer.nextToken();
                }
                stmt.getPrivileges().add("ALL");
            } else if (lexer.token() == Token.SELECT) {
                stmt.getPrivileges().add("SELECT");
                lexer.nextToken();
            } else if (lexer.token() == Token.UPDATE) {
                stmt.getPrivileges().add("UPDATE");
                lexer.nextToken();
            } else if (lexer.token() == Token.DELETE) {
                stmt.getPrivileges().add("DELETE");
                lexer.nextToken();
            } else if (lexer.token() == Token.INSERT) {
                stmt.getPrivileges().add("INSERT");
                lexer.nextToken();
            } else if (lexer.token() == Token.CREATE) {
                lexer.nextToken();

                if (lexer.token() == Token.TABLE) {
                    stmt.getPrivileges().add("CREATE TABLE");
                    lexer.nextToken();
                } else if (identifierEquals("SYNONYM")) {
                    stmt.getPrivileges().add("CREATE SYNONYM");
                    lexer.nextToken();
                } else {
                    throw new ParserException("TODO : " + lexer.token() + " " + lexer.stringVal());
                }
            }

            if (lexer.token() == Token.COMMA) {
                lexer.nextToken();
                continue;
            }
            break;
        }

        if (lexer.token() == Token.ON) {
            lexer.nextToken();
            stmt.setOn(this.exprParser.expr());
        }

        return stmt;
    }
View Full Code Here

        return stmt;
    }

    public SQLStatement parseGrant() {
        accept(Token.GRANT);
        OracleGrantStatement stmt = new OracleGrantStatement();

        for (;;) {
            if (lexer.token() == Token.ALL) {
                lexer.nextToken();
                if (identifierEquals("PRIVILEGES")) {
                    lexer.nextToken();
                }
                stmt.getPrivileges().add("ALL");
            } else if (lexer.token() == Token.SELECT) {
                stmt.getPrivileges().add("SELECT");
                lexer.nextToken();
            } else if (lexer.token() == Token.UPDATE) {
                stmt.getPrivileges().add("UPDATE");
                lexer.nextToken();
            } else if (lexer.token() == Token.DELETE) {
                stmt.getPrivileges().add("DELETE");
                lexer.nextToken();
            } else if (lexer.token() == Token.INSERT) {
                stmt.getPrivileges().add("INSERT");
                lexer.nextToken();
            } else if (lexer.token() == Token.CREATE) {
                lexer.nextToken();

                if (lexer.token() == Token.TABLE) {
                    stmt.getPrivileges().add("CREATE TABLE");
                    lexer.nextToken();
                } else if (identifierEquals("SYNONYM")) {
                    stmt.getPrivileges().add("CREATE SYNONYM");
                    lexer.nextToken();
                } else {
                    throw new ParserException("TODO : " + lexer.token() + " " + lexer.stringVal());
                }
            }

            if (lexer.token() == Token.COMMA) {
                lexer.nextToken();
                continue;
            }
            break;
        }

        if (lexer.token() == Token.ON) {
            lexer.nextToken();
            stmt.setOn(this.exprParser.expr());
        }

        return stmt;
    }
View Full Code Here

        return stmt;
    }

    public SQLStatement parseGrant() {
        accept(Token.GRANT);
        OracleGrantStatement stmt = new OracleGrantStatement();

        for (;;) {
            if (lexer.token() == Token.ALL) {
                lexer.nextToken();
                if (identifierEquals("PRIVILEGES")) {
                    lexer.nextToken();
                }
                stmt.getPrivileges().add("ALL");
            } else if (lexer.token() == Token.SELECT) {
                stmt.getPrivileges().add("SELECT");
                lexer.nextToken();
            } else if (lexer.token() == Token.UPDATE) {
                stmt.getPrivileges().add("UPDATE");
                lexer.nextToken();
            } else if (lexer.token() == Token.DELETE) {
                stmt.getPrivileges().add("DELETE");
                lexer.nextToken();
            } else if (lexer.token() == Token.INSERT) {
                stmt.getPrivileges().add("INSERT");
                lexer.nextToken();
            } else if (lexer.token() == Token.CREATE) {
                lexer.nextToken();

                if (lexer.token() == Token.TABLE) {
                    stmt.getPrivileges().add("CREATE TABLE");
                    lexer.nextToken();
                } else if (identifierEquals("SYNONYM")) {
                    stmt.getPrivileges().add("CREATE SYNONYM");
                    lexer.nextToken();
                } else {
                    throw new ParserException("TODO : " + lexer.token() + " " + lexer.stringVal());
                }
            }

            if (lexer.token() == Token.COMMA) {
                lexer.nextToken();
                continue;
            }
            break;
        }

        if (lexer.token() == Token.ON) {
            lexer.nextToken();
            stmt.setOn(this.exprParser.expr());
        }

        return stmt;
    }
View Full Code Here

        return stmt;
    }

    public SQLStatement parseGrant() {
        accept(Token.GRANT);
        OracleGrantStatement stmt = new OracleGrantStatement();

        for (;;) {
            if (lexer.token() == Token.ALL) {
                lexer.nextToken();
                if (identifierEquals("PRIVILEGES")) {
                    lexer.nextToken();
                }
                stmt.getPrivileges().add("ALL");
            } else if (lexer.token() == Token.SELECT) {
                stmt.getPrivileges().add("SELECT");
                lexer.nextToken();
            } else if (lexer.token() == Token.UPDATE) {
                stmt.getPrivileges().add("UPDATE");
                lexer.nextToken();
            } else if (lexer.token() == Token.DELETE) {
                stmt.getPrivileges().add("DELETE");
                lexer.nextToken();
            } else if (lexer.token() == Token.INSERT) {
                stmt.getPrivileges().add("INSERT");
                lexer.nextToken();
            } else if (lexer.token() == Token.CREATE) {
                lexer.nextToken();

                if (lexer.token() == Token.TABLE) {
                    stmt.getPrivileges().add("CREATE TABLE");
                    lexer.nextToken();
                } else if (identifierEquals("SYNONYM")) {
                    stmt.getPrivileges().add("CREATE SYNONYM");
                    lexer.nextToken();
                } else {
                    throw new ParserException("TODO : " + lexer.token() + " " + lexer.stringVal());
                }
            }

            if (lexer.token() == Token.COMMA) {
                lexer.nextToken();
                continue;
            }
            break;
        }

        if (lexer.token() == Token.ON) {
            lexer.nextToken();
            stmt.setOn(this.exprParser.expr());
        }

        return stmt;
    }
View Full Code Here

        return stmt;
    }

    public SQLStatement parseGrant() {
        accept(Token.GRANT);
        OracleGrantStatement stmt = new OracleGrantStatement();

        for (;;) {
            if (lexer.token() == Token.ALL) {
                lexer.nextToken();
                if (identifierEquals("PRIVILEGES")) {
                    lexer.nextToken();
                }
                stmt.getPrivileges().add("ALL");
            } else if (lexer.token() == Token.SELECT) {
                stmt.getPrivileges().add("SELECT");
                lexer.nextToken();
            } else if (lexer.token() == Token.UPDATE) {
                stmt.getPrivileges().add("UPDATE");
                lexer.nextToken();
            } else if (lexer.token() == Token.DELETE) {
                stmt.getPrivileges().add("DELETE");
                lexer.nextToken();
            } else if (lexer.token() == Token.INSERT) {
                stmt.getPrivileges().add("INSERT");
                lexer.nextToken();
            } else if (lexer.token() == Token.CREATE) {
                lexer.nextToken();

                if (lexer.token() == Token.TABLE) {
                    stmt.getPrivileges().add("CREATE TABLE");
                    lexer.nextToken();
                } else if (identifierEquals("SYNONYM")) {
                    stmt.getPrivileges().add("CREATE SYNONYM");
                    lexer.nextToken();
                } else {
                    throw new ParserException("TODO : " + lexer.token() + " " + lexer.stringVal());
                }
            }

            if (lexer.token() == Token.COMMA) {
                lexer.nextToken();
                continue;
            }
            break;
        }

        if (lexer.token() == Token.ON) {
            lexer.nextToken();
            stmt.setOn(this.exprParser.expr());
        }

        return stmt;
    }
View Full Code Here

        return stmt;
    }

    public SQLStatement parseGrant() {
        accept(Token.GRANT);
        OracleGrantStatement stmt = new OracleGrantStatement();

        for (;;) {
            if (lexer.token() == Token.ALL) {
                lexer.nextToken();
                if (identifierEquals("PRIVILEGES")) {
                    lexer.nextToken();
                }
                stmt.getPrivileges().add("ALL");
            } else if (lexer.token() == Token.SELECT) {
                stmt.getPrivileges().add("SELECT");
                lexer.nextToken();
            } else if (lexer.token() == Token.UPDATE) {
                stmt.getPrivileges().add("UPDATE");
                lexer.nextToken();
            } else if (lexer.token() == Token.DELETE) {
                stmt.getPrivileges().add("DELETE");
                lexer.nextToken();
            } else if (lexer.token() == Token.INSERT) {
                stmt.getPrivileges().add("INSERT");
                lexer.nextToken();
            } else if (lexer.token() == Token.CREATE) {
                lexer.nextToken();

                if (lexer.token() == Token.TABLE) {
                    stmt.getPrivileges().add("CREATE TABLE");
                    lexer.nextToken();
                } else if (identifierEquals("SYNONYM")) {
                    stmt.getPrivileges().add("CREATE SYNONYM");
                    lexer.nextToken();
                } else {
                    throw new ParserException("TODO : " + lexer.token() + " " + lexer.stringVal());
                }
            }

            if (lexer.token() == Token.COMMA) {
                lexer.nextToken();
                continue;
            }
            break;
        }

        if (lexer.token() == Token.ON) {
            lexer.nextToken();
            stmt.setOn(this.exprParser.expr());
        }

        return stmt;
    }
View Full Code Here

TOP

Related Classes of com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleGrantStatement

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.