public class ScriptReader extends java.io.LineNumberReader implements UpgConstants
DB2, doNotUpdateACTION, doNotUpdateALNDOMAIN, doNotUpdateAPPLICATIONAUTH, doNotUpdateAUTOKEY, doNotUpdateCONDITION, doNotUpdateCONTRACTPROPERTY, doNotUpdateCONTRACTTYPE, doNotUpdateCROSSOVERDOMAIN, doNotUpdateDOCTYPES, doNotUpdateLANGUAGE, doNotUpdateMAXAPPS, doNotUpdateMAXCONDDETAIL, doNotUpdateMAXCONTROLVALUE, doNotUpdateMAXDOMAIN, doNotUpdateMAXLOGAPPENDER, doNotUpdateMAXLOGGER, doNotUpdateMAXMENU, doNotUpdateMAXMESSAGES, doNotUpdateMAXMODULES, doNotUpdateMAXPROP, doNotUpdateMAXPROPVALUE, doNotUpdateMAXROLE, doNotUpdateMAXSEQUENCE, doNotUpdateMAXSERSECURITY, doNotUpdateMAXSERVICE, doNotUpdateMAXTABLEDOMAIN, doNotUpdateMAXVARS, doNotUpdateMAXVARTYPE, doNotUpdateMXCOLLAB, doNotUpdateMXCOLLABREF, doNotUpdateNUMERICDOMAIN, doNotUpdateNUMRANGEDOMAIN, doNotUpdatePORTLET, doNotUpdatePRICALC, doNotUpdateSECURITYRESTRICT, doNotUpdateSIGOPTION, doNotUpdateSYNONYMDOMAIN, doNotUpdateTAXTYPE, doNotUpdateWORKPRIORITY, doNotUpdateWORKTYPE, doNotUpdateWPEDITSETTING, messageCache, NEWONLY, OLDANDNEW, OLDONLY, ORACLE, SQLINET, SQLMICROSOFT, SQLSERVER, SYSDATATABLES, SYSTEMTABLES, UNKNOWN
Constructor and Description |
---|
ScriptReader(java.io.Reader in)
For example
|
ScriptReader(java.io.Reader in,
int sz) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getNextSql()
Get the next sql statement from the input file.
|
void |
setTriggerScript(boolean value)
Sets the value of
triggerScript . |
public ScriptReader(java.io.Reader in)
ScriptReader reader = new ScriptReader(new FileReader("foo.sql"));
public ScriptReader(java.io.Reader in, int sz)
public void setTriggerScript(boolean value)
triggerScript
.
Since this defaults to False, this method would be called only if we are reading
a trigger script that uses the delimiter [END TRIGGER]
.public java.lang.String getNextSql() throws java.lang.Exception
Remarks are identified as follows.
REM
, or
--
, or
/*
and
ends with *
/
. This class
presumes that the begin-block indicator is at the beginning
of a line, and the end-block indicator is at the end of a line.
Sql statements are identified as follows.
;
or
go
(upper or lower case).
triggerScript
was set to True
via setTriggerScript
, this will look for
[END TRIGGER]
as the separator between statements,
instead of ;
or go
.
(When triggerScript
is True,
[BEGIN TRIGGER]
markers are not needed.)
This is to support multiline triggers.
setTriggerScript
, it can still contain triggers,
as long as each trigger is preceded by [BEGIN TRIGGER]
and
followed by [END TRIGGER]
.
This is to support multiline triggers.
[BEGIN TRIGGER]
and [END TRIGGER]
markers are not needed. If the line begins with
CREATE OR REPLACE TRIGGER
then the terminator will be a slash
(/
).
CREATE OR REPLACE PROCEDURE
, the terminator will be a slash
(/
).
;
and go
, and excluding remarks.
If end of file, this will return null.java.lang.Exception
lastWasCommit