public int updateStock(ArrayList<Item> shpcart) {
		Connection con = null;
		int i = 0;
		try {
			con = ConnectionService.getConnection();
			String query = "update item set item_stock=item_stock-? where upc=?";
			PreparedStatement query_ps = con.prepareStatement(query);

			for (Item items : shpcart) {
				query_ps.setInt(1, items.getQuantity());
				query_ps.setString(2, items.getUPC());
				i = query_ps.executeUpdate();
				System.out.println(i);
			}
			con.commit();
		} catch (ConnectException e) {
			// TODO Auto-generated catch block
			try {
				con.rollback();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			try {
				con.rollback();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
		} finally {
			if (con != null) {
				try {
					con.close();
				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}

		return i;
	}