Java collections
- From: "tim@xxxxxxxxxxxxx" <tbil99@xxxxxxxxxxxx>
- Date: 3 May 2006 11:49:36 -0700
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);
}
.
- Follow-Ups:
- Re: Java collections
- From: Vova Reznik
- Re: Java collections
- Prev by Date: Re: Length of URL...
- Next by Date: Re: Java collections
- Previous by thread: Re: Length of URL...
- Next by thread: Re: Java collections
- Index(es):
Relevant Pages
|