Iterate each row in resultSet and map the columns to Kotlin classes by calling getString, getLong etc. Use next to retrieve the next row and close to close the connection.