I am trying to realize a java.sql.ResultSet into a map, in Scala.import java.sql.{ResultSet, ResultSetMetaData}class DbRow extends java.util.HashMap[java.lang.String, Object] {}object freeFunctions {  def realize(queryResult: ResultSet): Vector[DbRow] = {    val md = queryResult.getMetaData    val colNames = for (i <- 1 to md.getColumnCount) yield md.getColumnName(i)    var rows: Vector[DbRow] = Vector.empty    while (queryResult.next()) {      val row = new DbRow      for (n <- colNames) {        row.put(n, queryResult.getObject(n))      }      rows = rows :+ row    }    rows  }}I feel this could (should) be less verbose. If while/yield comprehensions existed, or somecomprehension for create a map. The client code needs a java map for now, but if an elegantenough solution can produce a Scala map, I could convert it.
Realizing a SQL ResultSet into a Map in Scala
scala;jdbc