Otherwise I end up iterating through the ResultSet twice - once on the
server to assign its values to an ArrayList of DTOs - and once after
its returned to the client in order to display the results. I'd rather
just assign (cast) the resultSet to the ArrayList and return it. For
example:
Rather than do this on the server:
resultSet = statement.executeQuery("SELECT first_name from
Employees");
while (resultSet.next()) {
arrayList.add(resultSet.getString("first_name")); //Loops through
over a hundred records
}
return arrayList;
It would be nice to simply do this:
resultSet = statement.executeQuery("SELECT first_name from
Employees");
arrayList = (ArrayList<Names>) resultSet; //Assign the entire
resultSet to the ArrayList
return arrayList;
Is this (or something similar) possible?
Thanks in advance,
-Russ
No
Regards, Lothar