Class ScriptReader

  • public class ScriptReader
    extends Object
    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.
    • Constructor Detail

      • ScriptReader

        public ScriptReader​(Reader reader)
        Create a new SQL script reader from the given reader
        reader - the reader
      • ScriptReader

        public ScriptReader​(String string)
    • Method Detail

      • readStatement

        public String readStatement()
                             throws IOException
        Read a statement from the reader. This method returns null if the end has been reached.
        the SQL statement or null
      • isInsideRemark

        public boolean isInsideRemark()
        Check if this is the last statement, and if the single line or block comment is not finished yet.
        true if the current position is inside a remark
      • isBlockRemark

        public boolean isBlockRemark()
        If currently inside a remark, this method tells if it is a block comment (true) or single line comment (false)
        true if inside a block comment
      • setRewrite

        public void setRewrite​(boolean rewrite)