Re: Java collections
- From: Vova Reznik <address@xxxxxxxx>
- Date: Wed, 03 May 2006 18:54:40 GMT
tim@xxxxxxxxxxxxx wrote:
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()) {
Customer Cust = new Customer();
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: tim@xxxxxxxxxxxxx
- Re: Java collections
- References:
- Java collections
- From: tim@xxxxxxxxxxxxx
- Java collections
- Prev by Date: Java collections
- Next by Date: Java Webservices, Tomcat question
- Previous by thread: Java collections
- Next by thread: Re: Java collections
- Index(es):