i am getting a problem in updating my database.
actually i am accessing two colums from my table and adding these two numbers ,
and the result i want to insert in the tables 3rd column
The statement i am using to access two columns
String str="select * from emp"
ResultSet rs=con.executeQuery(str);
while(rs.next())
{
int gs=rs.getInt("gross salary");
int al=rs.getInt("allowances"):
int total=gs+al;
con.updateQuery("insert into emp(total) values(total)");
}
i have a doubt about the statement
con.updateQuery("insert into emp(total) values(total)");
is it correct?
please help me out