Hi all

I am getting an error on the following code when I want to access the
variable "TotalSale" out side the loop.
***************************************************************************
 ResultSet Rs = sta.executeQuery("SELECT n_totalprice,id FROM orders
WHERE  ID = IDENT_CURRENT('orders')");

                     while (Rs.next()) {
                     float TotalSale = Rs.getFloat("n_totalprice");
                     System.out.println(TotalSale);// no error
                      }
 System.out.println(TotalSale);//Error TotalSale cannot be resolved
***************************************************************************

I am getting single value from the databse so i also tried with the
following code but still the result is same.

***************************************************************************
  if (Rs.next()){float TotalSale = Rs.getFloat("n_totalprice");}
***************************************************************************

Can any body please help me.Thank you in advance

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to