Class Update

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

public class Update extends SqlStatement<Update>
Used for INSERT, UPDATE, and DELETE statements
  • Constructor Details Link icon

  • Method Details Link icon

    • one Link icon

      public void one()
    • execute Link icon

      public int execute()
      Executes the statement, returning the update count.
      Returns:
      the number of rows modified
    • execute Link icon

      public <R> R execute(ResultProducer<R> producer)
      Executes the update, returning the result obtained from the given ResultProducer.
      Type Parameters:
      R - the result type
      Parameters:
      producer - the result producer.
      Returns:
      value returned by the result producer.
    • executeAndReturnGeneratedKeys Link icon

      public ResultBearing executeAndReturnGeneratedKeys(String... generatedKeyColumnNames)
      Execute the statement and returns any auto-generated keys. This requires the JDBC driver to support the Statement.getGeneratedKeys() method.
      Parameters:
      generatedKeyColumnNames - optional list of generated key column names.
      Returns:
      ResultBearing of generated keys
    • getHandle Link icon

      public final Handle getHandle()
    • getConfig Link icon

      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 Link icon

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

      @Beta public final Update 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 Link icon

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

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

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