Class Call

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

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

    • Call

      public Call(Handle handle, CharSequence sql)
    • Call

      public Call(Handle handle, String sql)
      Deprecated delegate - please use CharSequence signature for future compatibility.
  • 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 Closeable.close()d, 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 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.
    • close

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