kunaltyagi9 / Electricity-Billing-System

Electricity Billing System is a desktop based application developed in Java programming language. The project aims at serving the department of electricity by computerizing the billing system. It mainly focuses on the calculation of Units consumed during the specified time and the money to be paid to electricity offices. This computerized system will make the overall billing system easy, accessible, comfortable and effective for consumers.
51 stars 64 forks source link

Database #2

Closed AkkiGauts closed 3 years ago

AkkiGauts commented 3 years ago

When you click on pay bill the paytm page opens and after clicking back the status is not updated as paid.

Kamlesh780 commented 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.

kunaltyagi9 commented 3 years ago

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

kunaltyagi9 commented 3 years ago

Check if you are getting any exception on console? or check in the database if your status is updating or not

AkkiGauts commented 3 years ago

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 .

kunaltyagi9 commented 3 years ago

As mentioned by @AkkiGauts, using SET before column_name will resolve this Hence closing this issue