Class Script

All Implemented Interfaces:
Closeable, AutoCloseable, Configurable<Script>

public class Script extends SqlStatement<Script>
Represents a number of SQL statements delimited by semicolon which will be executed in order in a batch statement.
  • Constructor Details

  • Method Details

    • execute

      public int[] execute()
      Execute this script in a batch statement
      Returns:
      an array of ints which are the results of each statement in the script
    • executeAsSeparateStatements

      public void executeAsSeparateStatements()
      Execute this script as a set of separate statements
    • getStatements

      public List<String> getStatements()
      Locate the Script and split it into statements.
      Returns:
      the split statements
    • getHandle

      public final Handle getHandle()
    • getConfig

      public ConfigRegistry getConfig()
      Description copied from interface: Configurable
      Returns the configuration registry associated with this object.
      Specified by:
      getConfig in interface Configurable<This>
      Returns:
      the configuration registry associated with this object.
    • getContext

      public final StatementContext getContext()
      Returns the statement context associated with this statement.
      Returns:
      the statement context associated with this statement.
    • attachToHandleForCleanup

      @Beta public final Script attachToHandleForCleanup()
      Registers with the handle for cleaning when the handle is closed.
      There are some situations where Statements need to be cleaned up to avoid resource leaks. This method registers the current Statement it with the Handle. If the statement or the context are cleaned by themselves, it will automatically unregister, so in normal operations, resources should not pool for cleanup with the Handle.
      Since:
      3.35.0
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object