Interface ConnectionFunction<C,​T>

  • Type Parameters:
    C - the connection type, usually java.sql.Connection
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ConnectionFunction<C,​T>
    A function which makes use of a native database connection to compute a result. The connection is usually a JDBC connection.
    Since:
    3.2
    See Also:
    ConnectionConsumer, EntityManager.callWithConnection(ConnectionFunction)
    • Method Detail

      • apply

        T apply​(C connection)
         throws java.lang.Exception
        Compute a result using the given connection.
        Parameters:
        connection - the connection to use
        Returns:
        the result
        Throws:
        java.lang.Exception - if a problem occurs calling the connection, usually a java.sql.SQLException