Store int values into dynamic array

Hello all,

I'm a newbie in JAVA whose want to store int values (coming from a resultset) into an dynamic array. I know that normally to create a "dynamic array" you'd better use a Vector, but it seems that I don't know how to use it correctly (throws me a exception as : Incompatible type for method. Can't convert int[] to java.lang.Object[]).

Thanks in advance

STF

[417 byte] By [LearningSTF] at [2007-9-26 1:17:19]
# 1
Try using the object Integer instead of int.
johnga454 at 2007-6-29 0:46:42 > top of Java-index,Archived Forums,Java Programming...
# 2
You can't store simple types (int, char, double...) in a Vector. You must wrap them in objects. There is a class fore each simple type: Integer for int and Char for char...myVector.add(new Integer(anInt));
DanielN at 2007-6-29 0:46:42 > top of Java-index,Archived Forums,Java Programming...
# 3

I want to use the copyInto method of the vector, but it throw me an exception as ')' expected

I include a snip of my code below ;

Vector v= new Vector();

Vector vv=new Vector();

String[] labels=new String[v.size()];

Integer[] values=new Integer[vv.size()];

cont=rs.getInt("COUNT(CASE_ID_)");

vv.add(j,new Integer(cont));

log=rs.getString("ORIG_SUBMITTER");

v.add(j,new String(log));

v.copyInto(String[] labels);

vv.copyInto(Integer[] values);

LearningSTF at 2007-6-29 0:46:42 > top of Java-index,Archived Forums,Java Programming...
# 4
v.copyInto(String[] labels);should bev.copyInto(labels);likewise for the next one
parthasarkar at 2007-6-29 0:46:42 > top of Java-index,Archived Forums,Java Programming...