Closed AkkiGauts closed 3 years ago
When you click on pay bill the paytm page opens and after clicking back the status is not updated as paid.
Same with me.
This should not be the case because I am updating in the database
try{
Conn c = new Conn();
c.s.executeQuery("update bill status = 'Paid' where meter = '"+meter+"' AND month = '"+c1.getSelectedItem()+"'");
}catch(Exception e){}
On the click of Pay Button I am updating the status as Paid in Bill Table and I am picking the value of Status from the database
rs = c.s.executeQuery("select * from bill where meter = '"+meter+"' AND month = '"+c1.getSelectedItem()+"'");
while(rs.next()){
l13.setText(rs.getString("units"));
l14.setText(rs.getString("total_bill"));
l15.setText(rs.getString("status"));
}
So the next time you will get Status as Paid for the same parameters because now the value of Status is updated to Paid The implementation is already being done, If you are not getting this value there must be some another issue
Check if you are getting any exception on console? or check in the database if your status is updating or not
Try using syntax "update bill SET status...."
On Thu, 1 Apr, 2021, 4:38 PM Kunal Tyagi, @.***> wrote:
This should not be the case because I am updating in the database
try{ Conn c = new Conn(); c.s.executeQuery("update bill status = 'Paid' where meter = '"+meter+"' AND month = '"+c1.getSelectedItem()+"'"); }catch(Exception e){}
On the click of Pay Button I am updating the status as Paid in Bill Table and I am picking the value of Status from the database
rs = c.s.executeQuery("select * from bill where meter = '"+meter+"' AND month = '"+c1.getSelectedItem()+"'"); while(rs.next()){ l13.setText(rs.getString("units")); l14.setText(rs.getString("total_bill")); l15.setText(rs.getString("status")); }
So the next time you will get Status as Paid for the same parameters because now the value of Status is updated to Paid The implementation is already being done, If you are not getting this value there must be some another issue
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kunaltyagi9/Electricity-Billing-System/issues/2#issuecomment-811834137, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATJ2CWKSPJ4WQI7GTKRURL3TGRH2PANCNFSM4ZPGZNWQ .
As mentioned by @AkkiGauts, using SET before column_name will resolve this Hence closing this issue
When you click on pay bill the paytm page opens and after clicking back the status is not updated as paid.