Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void updateWyniki(int idProduktu, String ilosc) {
- String sql = "Select ilosc from magazyn where idProduktu =" + idProduktu;
- int counter = ilosc;
- try {
- ResultSet rs = st.executeQuery(sql);
- while (rs.next()) {
- counter += rs.getInt("ilosc");
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- sql = "UPDATE magazyn set ilosc = " + counter + " where idProduktu =" + idProduktu;
- executeUpdate(sql);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement