public void UpdateItem (String upc, int quan, float price) throws Exception {
		
		Connection con = ConnectionService.getConnection();
		
		int dbstock = 0;
		
		if (price < 0) 
			throw new Exception("Invalid Price");
		
		try {
			// get stock from database
			String query = "SELECT item_stock FROM item WHERE upc = ?";
			PreparedStatement ps = con.prepareStatement(query);

			ps.setString(1, upc);

			ResultSet rs = ps.executeQuery();

			if (!rs.next()) {
				throw new Exception("UPC not in DB");
		
			} else {
					dbstock = rs.getInt("item_stock");
			}
		} catch (SQLException e) {
			throw new Exception(" Item Not updated "+e.getMessage());

		}

		int current_stock = dbstock + quan;

		// update stock and price
		try {
			if (price < 0) { PreparedStatement ps1 = con
					.prepareStatement("UPDATE item "
							+ "SET item_stock = ?"
							+ "WHERE upc = ?");

			ps1.setInt(1, current_stock);
			ps1.setString(2, upc);
			ps1.executeQuery();
			
			con.commit();
			} else {
				PreparedStatement ps1 = con
						.prepareStatement("UPDATE item "
								+ "SET item_stock = ?, item_price = ?"
								+ "WHERE upc = ?");

				ps1.setInt(1, current_stock);
				ps1.setFloat(2, price);
				ps1.setString(3, upc);
				ps1.executeQuery();
				
				con.commit();
			}
		} catch (SQLException e) {
			try {
				con.rollback();
				throw new Exception("Error with updating item quantity and price");
			} catch (SQLException e1) {
				e1.printStackTrace();
			}
		}

	}