public Coupon getCoupon(String coupon) throws SQLException {
		if (!couponExists(coupon)) return null;
		ResultSet rs = sql.query("SELECT * FROM couponcodes WHERE name='"+coupon+"'");
		if (sql.getDatabaseOptions() instanceof MySQLOptions) rs.first();
		int usetimes = rs.getInt("usetimes");
		int time = rs.getInt("timeuse");
		HashMap<String, Boolean> usedplayers = plugin.convertStringToHash2(rs.getString("usedplayers"));
		
		if (rs.getString("ctype").equalsIgnoreCase("Item"))
			return createNewItemCoupon(coupon, usetimes, time, plugin.convertStringToHash(rs.getString("ids")), usedplayers);
		else if (rs.getString("ctype").equalsIgnoreCase("Economy"))
			return createNewEconomyCoupon(coupon, usetimes, time, usedplayers, rs.getInt("money"));
		else if (rs.getString("ctype").equalsIgnoreCase("Rank"))
			return createNewRankCoupon(coupon, rs.getString("groupname"), usetimes, time, usedplayers);
		else if (rs.getString("ctype").equalsIgnoreCase("Xp"))
			return createNewXpCoupon(coupon, rs.getInt("xp"), usetimes, time, usedplayers);
		else
			return null;
	}