Class DbResultSet

    • Method Detail

      • buildSupplier

        public static <T> JdbcSupplier<T> buildSupplier​(Connection conn,
                                                        String sql,
                                                        JdbcFunction<? super ResultSet,​? extends T> supplier)
        Builds supplier by connection and SQL string.
        This method would use Statement.executeQuery(java.lang.String) for getting result set.
        Type Parameters:
        T - The type of returned value
        Parameters:
        conn - The connection of database(won't be closed in the lambda)
        sql - The SQL to query data
        supplier - The supplier accepting result set from query
        Returns:
        The instance of lambda
      • buildSupplier

        public static <T> JdbcSupplier<T> buildSupplier​(Statement statement,
                                                        String sql,
                                                        JdbcFunction<? super ResultSet,​? extends T> supplier)
        Builds supplier by Statement and SQL string.
        This method would use Statement.executeQuery(java.lang.String) for getting result set.
        Type Parameters:
        T - The type of returned value
        Parameters:
        statement - The statement to be used(won't be closed in the lambda)
        sql - The SQL to query data
        supplier - The supplier accepting result set from query
        Returns:
        The instance of lambda