Class Call

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

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

  • Constructor Details

  • Method Details

    • createStatement

      PreparedStatement createStatement(String parsedSql) throws SQLException
      Overrides:
      createStatement in class SqlStatement<Call>
      Throws:
      SQLException
    • 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.