session.startOperationProfile(SessionProfiler.ROW_FETCH, dbCall.getQuery(), SessionProfiler.ALL);
try {
// Initial next was already validated before this method is called.
boolean hasNext = true;
while (hasNext) {
results.addElement(fetchRow(dbCall.getFields(), resultSet, metaData, session));
hasNext = resultSet.next();
}
resultSet.close();// This must be closed in case the statement is cached and not closed.
} catch (SQLException exception) {
//If this is a connection from an external pool then closeStatement will close the connection.