ontheball
asked on
Need to return multiple instances
I am editing some code where i am return a result set and dumping it into a particular instances of a class. Right now I am only getting one instances of the class being created. Previously there was only one record being returned from the DB, but now there is two. Only one instance is being created though.
From what I can see this is the method that needs to be dealt with.
Any suggestion welcome!
private void initializeColl(java.sql.Re sultSet x) {
this.x = new Vector(15);
try {
while (x.next()) {
this.x.add(new Amount(
x.getString("NAME"),
new Double(x.getString("FIRST_ AMOUNT")),
new Double(x.getString("NEXT_A MOUNT")),
x.getString("DATE"),
));
}
}
catch (java.sql.SQLException sqle) {
sqle.printStackTrace();
}
}
From what I can see this is the method that needs to be dealt with.
Any suggestion welcome!
private void initializeColl(java.sql.Re
this.x = new Vector(15);
try {
while (x.next()) {
this.x.add(new Amount(
x.getString("NAME"),
new Double(x.getString("FIRST_
new Double(x.getString("NEXT_A
x.getString("DATE"),
));
}
}
catch (java.sql.SQLException sqle) {
sqle.printStackTrace();
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ontheball:
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept CEHJ's comment as answer.
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Thomas Boshell
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
Accept CEHJ's comment as answer.
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Thomas Boshell
EE Cleanup Volunteer
get the resultset...