Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,152,456 members, 7,816,056 topics. Date: Friday, 03 May 2024 at 01:26 AM |
Nairaland Forum / Science/Technology / Programming / Please I Need Help On This Little Problem (877 Views)
Check Out This Little App I Made With React / Please I Need Help On This Little Problem / Java Gurus Please I Need This Little Assignment Solved ''appreciation Involved" (2) (3) (4)
(1) (Reply)
Please I Need Help On This Little Problem by ibroauthen(m): 8:38am On Apr 15, 2018 |
Hello my ogas at the top. I am just learning Java programming language and I have a project on medical store that I am working on but I have a little problem. I created a button and I want the button to deduct the number of drugs order through a jtextfield but when ever I press the button it only places order but won't deduct any value from the db. This is the code I used. String val=jLabel5.getText(); String val1=Jtextfield5.getText(); int val2= Integer.parseInt(val1); try{ String sql=" update druginfo set qty ='" +val1+"' where id='" +val+"' " ; pst=conn.PrepareStatement(sql): rst=pst.executeUpdate(); while(rst.next()) { String add=rst.getInt("qty" } add-val2; } catch(Exception e) { JOptionPane.showMessageDialog(null, e); } But the code is not getting the job done. Please help a brother in need I have searched Google and found no reasonable answer. |
(1) (Reply)
A Programming Partnership Offer. / How To Create A Link On Post Title In My Blog Home Page. I / Where Do I Get Consulting Services About Software Developing?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 6 |