Class Update

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, Configurable<Update>

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

      • Update

        public Update​(Handle handle,
                      java.lang.CharSequence sql)
      • Update

        public Update​(Handle handle,
                      java.lang.String sql)
        Backwards compatible constructor that takes an explicit string argument.
        See Also:
        Update(Handle, CharSequence)
    • Method Detail

      • one

        public void one()
      • execute

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

        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

        public ResultBearing executeAndReturnGeneratedKeys​(java.lang.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