}
public SQLStatement parseCreateDbLink() {
accept(Token.CREATE);
OracleCreateDatabaseDbLinkStatement dbLink = new OracleCreateDatabaseDbLinkStatement();
if (identifierEquals("SHARED")) {
dbLink.setShared(true);
lexer.nextToken();
}
if (identifierEquals("PUBLIC")) {
dbLink.setPublic(true);
lexer.nextToken();
}
accept(Token.DATABASE);
acceptIdentifier("LINK");
dbLink.setName(this.exprParser.name());
if (lexer.token() == Token.CONNECT) {
lexer.nextToken();
accept(Token.TO);
dbLink.setUser(this.exprParser.name());
if (lexer.token() == Token.IDENTIFIED) {
lexer.nextToken();
accept(Token.BY);
dbLink.setPassword(lexer.stringVal());
accept(Token.IDENTIFIER);
}
}
if (identifierEquals("AUTHENTICATED")) {
lexer.nextToken();
accept(Token.BY);
dbLink.setAuthenticatedUser(this.exprParser.name());
accept(Token.IDENTIFIED);
accept(Token.BY);
dbLink.setPassword(lexer.stringVal());
accept(Token.IDENTIFIER);
}
if (lexer.token() == Token.USING) {
lexer.nextToken();
dbLink.setUsing(this.exprParser.expr());
}
return dbLink;
}