Class Call

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

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

      • Call

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

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

      • createStatement

        java.sql.PreparedStatement createStatement​(java.lang.String parsedSql)
                                            throws java.sql.SQLException
        Overrides:
        createStatement in class SqlStatement<Call>
        Throws:
        java.sql.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​(java.lang.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​(java.lang.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​(java.util.function.Consumer<OutParameters> resultConsumer)
        Invoke the callable statement and process its OutParameters results.
      • invoke

        public <T> T invoke​(java.util.function.Function<OutParameters,​T> resultComputer)
        Invoke the callable statement and process its OutParameters results, returning a computed value of type T.