public Boolean addSessionIdColumn(String tableName, String columnSessionIdName,
			int interval) {
		// ȡsessionsĲѯ
		if (!addNewColumn(tableName, columnSessionIdName, "int"))
			return false;
		int intSessionId=0;
		String sql = "select id,uid,ip,date,staytime,"+columnSessionIdName+" from " + tableName
				+ " order by uid ASC,date ASC";
		ClsSession currentSession = null;// ǰ ĻỰΪ
		ClsRecord currentRecord = null;// ǰļ¼Ϊ
		try {
			ResultSet rs = executeUpdateQuery(sql);
			// ȡ¼
			rs.last();
			int rowNum = rs.getRow();
			ClsTime ct = new ClsTime((double) rowNum / NumPerFlicker);// üʱ
			ct.estimateStart(rowNum);
			rs.first();
			rs.previous();
			while (rs.next()) {
				ct.estimating(rs.getRow());
				// ȥؼֶεļ¼
				currentRecord = new ClsRecord();
				
				if (rs.getString("uid") == null)
					continue;
				if (rs.getString("ip") == null)
					continue;
				if (rs.getTimestamp("date") == null)
					continue;
				else
					currentRecord.setVisitTime(rs.getTimestamp("date"));
				if (rs.getInt("staytime") != 0)
					currentRecord.setVisitDuration(rs.getInt("staytime"));

				if (currentSession == null) {// ûлỰǵһỰ
					currentSession = new ClsSession();// еĵһỰ
					currentSession.receiveSessionFirstRecord(currentRecord,
							rs.getString("uid"), rs.getString("ip"));
					intSessionId++;
					rs.updateInt(columnSessionIdName,intSessionId);
					rs.updateRow();
					currentRecord = null;
					continue;
				}
				if (currentSession.getSessionUserId().equals(
						rs.getString("uid"))
						&& currentSession.getSessionUserIp().equals(
								rs.getString("ip"))
						&& (currentRecord.getVisitTime().getTime() - currentSession
								.getSessionTimeEnd().getTime()) / 1000 / 60 < interval) {
					currentSession.receiveSessionLaterRecord(currentRecord);
					rs.updateInt(columnSessionIdName,intSessionId);
					rs.updateRow();
					currentRecord = null;
				} else {
//					 cfStat.WriteFile(currentSession
//					 .SerializeSessionStatistics() + "\n");
					intSessionId++;
					rs.updateInt(columnSessionIdName,intSessionId);
					rs.updateRow();
					currentSession = null;
					currentSession = new ClsSession();
					currentSession.receiveSessionFirstRecord(currentRecord,
							rs.getString("uid"), rs.getString("ip"));
					currentRecord = null;
				}
			}
			if (currentSession != null) {// һsession
//				 cfStat.WriteFile(currentSession.SerializeSessionStatistics()
//				 + "\n");
				currentSession = null;
			}
			ct.estimateEnd();
			rs.close();
			return true;
		} catch (SQLException e) {
			e.printStackTrace();
			System.out.println("ȡûỰʧ");
			return false;
		}
	}