• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calculation on data retrieved from database

 
Karamjeet singh
Ranch Hand
Posts: 52
Flex jQuery Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "it terminates" mean? What is or isn't executed? Are there any error messages in the log files?
 
Karamjeet singh
Ranch Hand
Posts: 52
Flex jQuery Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this not throwing any exceptions
it terminates where the callculations start
see output

 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
Flex jQuery Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
Flex jQuery Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
problem is solved
i have two catch blocks in my code with same objects like this
i change

to


and it works
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic