Interface DatabaseAPI.Update

All Superinterfaces:
AutoCloseable, DatabaseAPI.StatementCommon
Enclosing interface:
DatabaseAPI

public static interface DatabaseAPI.Update
extends DatabaseAPI.StatementCommon
Wrapping a prepared update to be more suitable for Java 8 onwards. This supports prepared statements that do not yield result sets, but may (in some circumstances) generate IDs.

Note that, as a security measure, most database connectors do not support putting multiple statements in a single prepared statement.

Author:
Donal Fellows
  • Method Details

    • call

      int call​(Object... arguments)
      Run the update on the given arguments.
      Parameters:
      arguments - Positional argument to the query
      Returns:
      The number of rows updated
    • key

      Optional<Integer> key​(Object... arguments)
      Run the update on the given arguments. This is expected to generate a single integer primary key (common with INSERT).
      Parameters:
      arguments - Positional arguments to the query
      Returns:
      The integer primary key generated by the update.
      See Also:
      GeneratesID