Creating int but size needes to vary
I need to create an int array in which the size needs to vary, is there a class that suits my needs so that I don't need to write something myself?
As a bit of background: The values for this array are coming out of a SQL ResultSet. I should only need a single int from each record (could change later though), but depending on the database queried, the array will differ in size.
I suppose I could do the query, run a loop to ResultSet.next() through it, incrementing a value (lets say 'i' for interest sake) as I go and then use ResultSet.first() to return to the first row of the ResultSet and then start recording in the array of size 'i'. However this seems silly and inefficient as it means I need to run through the ResultSet twice. Does anyone know of a class that could create an array with no fixed size?
EDIT: Apologies for the spelling in the title, it hurts my eyes too.