Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try{
- String url="jdbc:sqlserver://LENOVO-PC\SQL2012:1433;databaseName=qseal" ;
- String user="sa";
- String pass="123";
- Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
- Connection con=DriverManager.getConnection(url,user,pass);
- String sql="update inventorytable set quntity=(quantity-?) where product_code=?";
- PreparedStatement pst=con.prepareStatement(sql);
- pst.setInt(1,Integer.parseInt(Quantity.getText()));
- pst.setString(2,ProductCode.getText());
- Quantity.setText("");
- ProductCode.setText("");
- close();
- GenerateBill gb=new GenerateBill();
- gb.setVisible(true);
- }
- catch(Exception e){
- JOptionPane.showMessageDialog(this, e.getMessage());
- }
- "update inventorytable set quntity=(quantity-" + UserData + ") where product_code=?"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement