Class Call

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

public class Call extends SqlStatement<Call>
Used for invoking stored procedures.
  • Constructor Details

  • Method Details

    • registerOutParameter

      public Call registerOutParameter(int position, int sqlType)
      Register a positional output parameter.
      Parameters:
      position - the parameter position (zero-based)
      sqlType - an SQL type constant as defined by Types or by the JDBC vendor.
      Returns:
      self
    • registerOutParameter

      public Call registerOutParameter(int position, int sqlType, CallableStatementMapper mapper)
      Register a positional output parameter.
      Parameters:
      position - the parameter position (zero-based)
      sqlType - an SQL type constant as defined by Types or by the JDBC vendor.
      mapper - a mapper which converts the CallableStatement to a desired output type.
      Returns:
      self
    • registerOutParameter

      public Call registerOutParameter(String name, int sqlType)
      Register a named output parameter.
      Parameters:
      name - the parameter name
      sqlType - an SQL type constant as defined by Types or by the JDBC vendor.
      Returns:
      self
    • registerOutParameter

      public Call registerOutParameter(String name, int sqlType, CallableStatementMapper mapper)
      Register a named output parameter.
      Parameters:
      name - the parameter name
      sqlType - an SQL type constant as defined by Types or by the JDBC vendor.
      mapper - a mapper which converts the CallableStatement to a desired output type.
      Returns:
      self
    • invoke

      public OutParameters invoke()
      Invoke the callable statement. Note that the statement will be cleaned up, so cursor-typed values may not work.
      Returns:
      the output parameters resulting from the invocation.
    • invoke

      public void invoke(Consumer<OutParameters> resultConsumer)
      Invoke the callable statement and process its OutParameters results.
    • invoke

      public <T> T invoke(Function<OutParameters,T> resultComputer)
      Invoke the callable statement and process its OutParameters results, returning a computed value of type T.
    • 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

      @Alpha public final Call 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