Treating an SQL ResultSet like a Scala Stream

I didn’t test it, but why wouldn’t it work?

new Iterator[String] {
  def hasNext = resultSet.next()
  def next() = resultSet.getString(1)
}.toStream

Leave a Comment