public void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		req.setCharacterEncoding("UTF-8");

		resp.setContentType("text/xml");
		PrintWriter writer = resp.getWriter();

		String gameId = req.getParameter("gameId");
		if (gameId == null || gameId.equals("")) {
			writer.println("ERROR");
			return;
		}

		Game game = new Game();
		game.setGameId(gameId);

		game.setDate(getLongParameter(req, "gameDate"));
		game.setHoleCount(getIntParameter(req, "holeCount"));
		game.setPlayerCount(getIntParameter(req, "playerCount"));

		game.setHoleFee(getIntParameter(req, "holeFee"));
		game.setExtraFee(getIntParameter(req, "extraFee"));
		game.setRankingFee(getIntParameter(req, "rankingFee"));
		String fieldName = req.getParameter("fieldName");
		if (fieldName == null) {
			fieldName = "";
		}
		game.setFieldName(fieldName);
		game.setFairwayDifficulty(getIntParameter(req, "fairwayDifficulty"));
		game.setGreenDifficulty(getIntParameter(req, "greenDifficulty"));

		for (int i = 0; i < 6; i++) {
			game.setHoleFeePerRanking(i + 1,
					getIntParameter(req, "holeFeePerRanking" + (i + 1)));
			game.setRankingFeePerRanking(i + 1,
					getIntParameter(req, "rankingFeePerRanking" + (i + 1)));

			String playerName = new String(req.getParameter("playerName" + i)
					.getBytes("utf-8"), "utf-8");
			game.setPlayerName(i, playerName);
			game.setHandicap(i, getIntParameter(req, "handicap" + i));
			game.setExtraScore(i, getIntParameter(req, "extraScore" + i));
		}

		updateGame(game);

		int resultCount = getIntParameter(req, "resultCount");
		ArrayList<Result> results = new ArrayList<Result>();
		for (int i = 0; i < resultCount; i++) {
			Result result = new Result();
			result.setGameId(gameId);

			result.setHoleNumber(getIntParameter(req, "holeNumber_" + i));
			result.setParCount(getIntParameter(req, "parCount_" + i));

			for (int j = 0; j < 6; j++) {
				result.setScore(j,
						getIntParameter(req, "result_score_" + i + "_" + j));
				result.setUsedHandicap(
						j,
						getIntParameter(req, "result_usedHandicap_" + i + "_"
								+ j));
			}

			results.add(result);
		}

		updateResults(gameId, results);

		long time = new Date().getTime();
		backupGame(time, game);
		backupResults(time, gameId, results);

		updateTick(time);

		writer.println("OK");

	}