CHECK_CALL_1
protected static final String CHECK_CALL_1
CHECK_CALL_2
protected static final String CHECK_CALL_2
CHECK_DATE
protected static final String CHECK_DATE
CHECK_ESCAPE
protected static final String CHECK_ESCAPE
CHECK_FUNCTION
protected static final String CHECK_FUNCTION
CHECK_OUTERJOIN
protected static final String CHECK_OUTERJOIN
CHECK_TIME
protected static final String CHECK_TIME
CHECK_TIMESTAMP
protected static final String CHECK_TIMESTAMP
ESCAPE_CALL_KEYWORD
public static final String ESCAPE_CALL_KEYWORD
ESCAPE_CALL_KEYWORD3
public static final String ESCAPE_CALL_KEYWORD3
ESCAPE_DATE_KEYWORD
public static final String ESCAPE_DATE_KEYWORD
ESCAPE_ESCAPE_KEYWORD
public static final String ESCAPE_ESCAPE_KEYWORD
ESCAPE_FUNCTION_KEYWORD
public static final String ESCAPE_FUNCTION_KEYWORD
ESCAPE_OUTERJOIN_KEYWORS
public static final String ESCAPE_OUTERJOIN_KEYWORS
ESCAPE_STATE
protected static final int ESCAPE_STATE
ESCAPE_TIMESTAMP_KEYWORD
public static final String ESCAPE_TIMESTAMP_KEYWORD
ESCAPE_TIME_KEYWORD
public static final String ESCAPE_TIME_KEYWORD
LITERAL_STATE
protected static final int LITERAL_STATE
NORMAL_STATE
protected static final int NORMAL_STATE
UNDEFINED_STATE
protected static final int UNDEFINED_STATE
USE_BUILT_IN
public static final int USE_BUILT_IN
USE_STANDARD_UDF
public static final int USE_STANDARD_UDF
checkForEscapes
protected boolean checkForEscapes(String sql)
Check if the target SQL contains at least one of the escaped syntax
commands. This method performs simple substring matching, so it may
report that SQL contains escaped syntax when the
"{"
is followed by the escaped syntax command in regular string constants
that are passed as parameters. In this case
parse(String)
will
perform complete SQL parsing.
true
if the sql
is suspected to contain
escaped syntax.
convertEscapeString
protected String convertEscapeString(String escapeString)
Convert the "{escape '...'}"
call into the corresponding
escape clause for Firebird.
escapeString
- escape string to convert
convertEscapedFunction
protected String convertEscapedFunction(String escapedFunction)
throws FBSQLParseException
This method converts escaped function to a server function call. Actually
we do not change anything here, we hope that all UDF are defined.
escapedFunction
- escaped function call
- server-side function call.
convertOuterJoin
protected String convertOuterJoin(String outerJoin)
throws FBSQLParseException
This method converts the escaped outer join call syntax into the
native outer join. Actually, we do not change anything here, since
Firebird's syntax is the same.
convertProcedureCall
protected String convertProcedureCall(String procedureCall)
throws FBSQLException
This methods converts the escaped procedure call syntax into the
native procedure call.
procedureCall
- part of {call proc_name(...)} without curly braces
and "call" word.
escapeToNative
protected String escapeToNative(String escaped)
throws FBSQLException
This method checks the passed parameter to conform the escaped syntax,
checks for the unknown keywords and re-formats result according to the
Firebird SQL syntax.
escaped
- the part of escaped SQL between the '{' and '}'.
- the native representation of the SQL code.
getLastState
protected int getLastState()
Returns the current state.
getState
protected int getState()
Returns the current state.
isInState
protected boolean isInState(int state)
Returns if the system is in state state
.
true
if the system is in state state
.
parse
public String parse(String sql)
throws FBSQLException
Converts escaped parts in the passed SQL to native representation.
processEscaped
protected void processEscaped(String escaped,
StringBuffer keyword,
StringBuffer payload)
setState
protected void setState(int state)
throws IllegalStateException
Sets the current state.
supportsLikeEscapeClause
public static boolean supportsLikeEscapeClause()
supportsStoredProcedures
public static boolean supportsStoredProcedures()
switchState
protected void switchState(char testChar)
Test the character to be the state switching character and switches
the state if necessary.
testChar
- character to test
toDateString
protected String toDateString(String dateStr)
throws FBSQLParseException
This method converts the 'yyyy-mm-dd' date format into the
Firebird understandable format.
dateStr
- the date in the 'yyyy-mm-dd' format.
- Firebird understandable date format.
toTimeString
protected String toTimeString(String timeStr)
throws FBSQLParseException
This method converts the 'hh:mm:ss' time format into the
Firebird understandable format.
timeStr
- the date in the 'hh:mm:ss' format.
- Firebird understandable date format.
toTimestampString
protected String toTimestampString(String timestampStr)
throws FBSQLParseException
This method converts the 'yyyy-mm-dd hh:mm:ss' timestamp format into the
Firebird understandable format.
timestampStr
- the date in the 'yyyy-mm-dd hh:mm:ss' format.
- Firebird understandable date format.
wasInState
protected boolean wasInState(int state)
Returns if the system was in state state
.
true
if the system was in state state
.