Java collections



I've create a small program that loops through a database table and
adds columns of the retrieved row to a collection.
For some reason, the Collection.add statement seems to be changing all
of the data to the contents of the last row processed.
Any Idea what would cause this? I am running it through the debug mode
of Eclipse and can see it happen during the add statement.

Here is a snippet of the code.

while (rset.next()) {
Cust.setCUST_NUMBER(rset.getInt(1));
Cust.setLAST_NAME(rset.getString(2));
Cust.setFIRST_NAME(rset.getString(3));
Cust.setSEX(rset.getString(4));
Cust.setCITY(rset.getString(5));
CustomerCollection.add(Cust);
}

.



Relevant Pages

  • Startup just loops
    ... For some reason XP will not start up properly. ... computer continues to act like it is going to start up ... properly but it just loops. ... my computer - which is the main response in the database. ...
    (microsoft.public.windowsxp.general)
  • Re: Retrieve and update from SQL
    ... Javier wrote: ... > and update some column in this retrieved row. ... Use the programming API for the database you are trying to connect to? ...
    (comp.lang.cpp)
  • Re: Java collections
    ... adds columns of the retrieved row to a collection. ... For some reason, the Collection.add statement seems to be changing all ... of Eclipse and can see it happen during the add statement. ... Here is a snippet of the code. ...
    (comp.lang.java.programmer)
  • Re: Retrieve and update from SQL
    ... > Javier wrote: ... >> and update some column in this retrieved row. ... > Use the programming API for the database you are trying to connect to? ...
    (comp.lang.cpp)