Class Streamer


  • public class Streamer
    extends java.lang.Object
    Simple implementation taking a JDBC ResultSet and rendering it using the Java Streams API.
    The JDBC API is really starting to show its age here
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Streamer.Row
      Inner class representing each row of the ResultSet as it flows down the stream.
    • Constructor Summary

      Constructors 
      Constructor Description
      Streamer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.stream.Stream<Streamer.Row> wrap​(java.sql.ResultSet rs)
      Wrap the JDBC ResultSet as a stream object.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Streamer

        public Streamer()
    • Method Detail

      • wrap

        public java.util.stream.Stream<Streamer.Row> wrap​(java.sql.ResultSet rs)
                                                   throws java.sql.SQLException
        Wrap the JDBC ResultSet as a stream object. Note that the stream has to be consumed within the boundaries of the statement execution
        Parameters:
        rs -
        Returns:
        Throws:
        java.sql.SQLException