public class Parser extends Object
Modifier and Type | Method and Description |
---|---|
Session |
getSession() |
static boolean |
isKeyword(String s,
boolean supportOffsetFetch)
Checks if this string is a SQL keyword.
|
Expression |
parseExpression(String sql)
Parse a SQL code snippet that represents an expression.
|
Prepared |
prepare(String sql)
Parse the statement and prepare it for execution.
|
Command |
prepareCommand(String sql)
Parse a statement or a list of statements, and prepare it for execution.
|
static String |
quoteIdentifier(String s)
Add double quotes around an identifier if required.
|
void |
setRightsChecked(boolean rightsChecked) |
public Parser(Session session)
public Prepared prepare(String sql)
sql
- the SQL statement to parsepublic Command prepareCommand(String sql)
sql
- the SQL statement to parsepublic Session getSession()
public static boolean isKeyword(String s, boolean supportOffsetFetch)
s
- the token to checksupportOffsetFetch
- if OFFSET and FETCH are keywordspublic static String quoteIdentifier(String s)
s
- the identifierpublic void setRightsChecked(boolean rightsChecked)
public Expression parseExpression(String sql)
sql
- the code snippetCopyright © 2012 JBoss by Red Hat. All Rights Reserved.