public String updateQuantity(int quantitydeduct,int adid)
	{
		String query =null,result=null;
		ResultSet rs;
		int quan=0;
		int rowcount;
		
		try
		{
			System.out.println("Inside inserttransactionupdate");
		query = "select quantity from advertisement where adid = " + adid + "";
		rs = stmt.executeQuery(query);
		
		if(rs!=null)
		{
			while(rs.next())
			{
				quan = rs.getInt("quantity");
			}
			query ="update advertisement set quantity =" + (quan-quantitydeduct) + " where adid ="+ adid + "";
			rowcount = stmt.executeUpdate(query);
			
			if(rowcount > 0)
			{
			System.out.println("Record successfully updated");
			result = "true";
		
			}
		else
			{
			result = "false";
			}
		}
		
		}
		catch(SQLException s)
		{
			s.printStackTrace();
		}
		finally
		{
			try
			{
				if(stmt!=null)
				{
					con.close();
				}
			}
			catch(SQLException s)
			{
					//do nothing
			}
			
			try
			{
				if(con!=null)
				{
					con.close();
				}
			}
			catch(SQLException se)
			{
				se.printStackTrace();
			}
			
		}
		return result;
	}