i have a method that needs to return a collection of objects, say Customers. each row of a table represents the fields of the Customer object. performancewise, is it better to have the method return an array of Customers (ie Customer[]) or a java.util.List/java.util.Vector containing Customer objects?
I personally like the method returning Customer[] because it makes a cleaner method signature.
since i don't know the number of objects that will be returned beforehand (size of array to allocate), i could do 2 queries: select count(*) and the data gather query. Alternatively, i could use 1 query, make a List, then call List's toArray(Object[] a) method. Is there major overhead with that method?
How do you guys deal with methods that return objects created from db queries?