Author
calculation on data retrieved from database
Karamjeet singh
Ranch Hand
Joined: Feb 24, 2010
Posts: 49
problem in retrieving data from database
i want to do calculation on data retrieved from database
first two rows it prints perfectly but after that it terminates where calculation starts
i don't know what i am doing wrong
Don't aim for success if you want it; just do what you love and believe in, and it will come naturally.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35443
posted Mar 10, 2010 04:08:28
0
What does "it terminates" mean? What is or isn't executed? Are there any error messages in the log files?
Android apps – ImageJ plugins – Java web charts
Karamjeet singh
Ranch Hand
Joined: Feb 24, 2010
Posts: 49
this not throwing any exceptions
it terminates where the callculations start
see output
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35443
posted Mar 10, 2010 04:21:13
0
this not throwing any exceptions
Are you sure about that? There isn't an empty catch block somewhere, is there?
Does the ResultSet contain a column called "discount"?
By the way, you should never do calculations involving amounts of money using integers (or floats or doubles); use BigDecimal instead.
Karamjeet singh
Ranch Hand
Joined: Feb 24, 2010
Posts: 49
Are you sure about that?
yes i am sure.there is no empty catch block there
there is column in my database called discount
from where i am retrieving value
Karamjeet singh
Ranch Hand
Joined: Feb 24, 2010
Posts: 49
problem is solved
i have two catch blocks in my code with same objects like this
i change
to
and it works
subject: calculation on data retrieved from database