private void bSaveActionPerformed(java.awt.event.ActionEvent evt){
int rows = aw.getRowCount();
for(int i = 0; i
try{
String sql = "INSERT INTO Sales (ProductID,BuyerID,Quantity,Discount,Transactiontype,TransactionDate) values (?,?,?,?,?,?)";
pst = conn.prepareStatement(sql);
pst.setString(1, productID.getText());
pst.setString(2,buyerid.getText());
pst.setString(3, prodQty.getText());
pst.setString(4, dc1.getText());
pst.setString(5, Type.getSelectedItem().toString());
pst.setString(6, dt.getText());
pst.execute();
//JOptionPane.showMessageDialog(null, "Saved");
rs.close();
pst.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
JOptionPane.showMessageDialog(null, "Saved!");}
}