ScriptReader
This class can split SQL scripts to single SQL statements.
Each SQL statement ends with the character ';', however it is ignored
in comments and quotes.
| Methods |
|
ScriptReader(Reader reader)
Create a new SQL script reader from the given reader
|
|
ScriptReader(Reader reader)
Create a new SQL script reader from the given reader
Parameters:
reader - the reader
|
| void |
close()
Close the underlying reader.
|
| void |
close()
Close the underlying reader.
|
| boolean |
()
If currently inside a remark, this method tells if it is a block comment
(true) or single line comment (false)
|
| boolean |
()
If currently inside a remark, this method tells if it is a block comment
(true) or single line comment (false)
Returns:
true if inside a block comment
|
| boolean |
()
Check if this is the last statement, and if the single line or block
comment is not finished yet.
|
| boolean |
()
Check if this is the last statement, and if the single line or block
comment is not finished yet.
Returns:
true if the current position is inside a remark
|
| String |
readStatement()
Read a statement from the reader.
|
| String |
readStatement()
Read a statement from the reader. This method returns null if the end has
been reached.
Returns:
the SQL statement or null
|
| void |
(boolean skipRemarks)
If comments should be skipped completely by this reader.
|
| void |
(boolean skipRemarks)
If comments should be skipped completely by this reader.
Parameters:
skipRemarks - true if comments should be skipped
|
|