Change this to a function directly instead of a val for a closure. i.e.

def resultSetToObjectArray(rs: ResultSet) = {
  Array.tabulate[Object](rs.getMetaData.getColumnCount)(i => rs.getObject(i + 1))
}