public void StoreStockPriceToDB(boolean clean) {
		log.info("start store stock price to db...");
		
		String sql;
		int stock_num = 0;
		//key:market+code+name, value:date->PriceRecord
		for (String key : stock_map.keySet().toArray(new String[0])) {
			
			String arrs[] = key.split(",");
			String market = arrs[0];
			String code = arrs[1];
			String name = " ";
			if (arrs.length == 3) {
				name = arrs[2];
			}
			
			String table_name = STOCK_PRICE_TABLE_PRE + market;
			
			if (stock_price_market_map.get(market).booleanValue() != true) {
				sql = "create table if not exists " + table_name + 
						"(" +
						"`code` varchar(32) not null default '', " +
						"`name` varchar(64) not null default '', " +
						"`day` DATE not null default '0000-00-00', " +
						"`open` double NOT NULL default '0', " +
						"`close` double NOT NULL default '0', " +
						"`is_holiday` int NOT NULL default '0', " +
						"PRIMARY KEY (`code`, `day`) " +
						") ENGINE=InnoDB DEFAULT CHARSET=utf8 " +
						"partition by key(code) " +
						"partitions 200";	
				log.info("	" + sql);
				dbInst.updateSQL(sql);
				stock_price_market_map.put(market, Boolean.TRUE);
			}
			
			stock_num++;
			log.info("	store " + stock_num + ":" + market + "-" + code + "-" + name);
			
			//清理历史数据
			if (clean) {
				sql = "delete from " + table_name + " where code = '" + code + "'";
				log.info("	" + sql);
				dbInst.updateSQL(sql);
			}
			
			TreeMap<String, PriceRecord> stock_price = new TreeMap<String, PriceRecord>(stock_map.get(key));
			//key:date, value:PriceRecord
			log.info("start insert records");
			int count = 0;
//			for (String day : stock_price.keySet().toArray(new String[0])) {
//				PriceRecord pr = stock_price.get(day);
//				sql = "insert into " + table_name + 
//						"(`code`, `name`, `day`, `open`, `close`, `is_holiday`) values " +
//						"('" + code + "', " + 
//						"'" + name + "', " + 
//						"'" + day + "', " + 
//						pr.open + "," + 
//						pr.close + "," +
//						pr.is_holiday + ") " +
//						"ON DUPLICATE KEY UPDATE " +
//						"`name` = '" + name + "', " + 
//						"`open` = " + pr.open + "," +
//						"`close` = " + pr.close + "," +
//						"`is_holiday` = " + pr.is_holiday;
//				dbInst.updateSQL(sql);
//				count++;
//				if (count % 1000 == 0) {
//					log.info("insert " + count + " records");
//				}
//			}
			
			sql = "insert into " + table_name + 
			"(`code`, `name`, `day`, `open`, `close`, `is_holiday`) values ";
			
			for (String day : stock_price.keySet().toArray(new String[0])) {
				PriceRecord pr = stock_price.get(day);
				sql = sql + "('" + code + "', " + 
						"'" + name + "', " + 
						"'" + day + "', " + 
						pr.open + "," + 
						pr.close + "," +
						pr.is_holiday + "), ";
				count++;
				if (count % 1000 == 0) {
					log.info("insert " + count + " records");
					sql = sql.substring(0, sql.length() - 2) + ";";
					dbInst.updateSQL(sql);
					sql = "insert into " + table_name + 
							"(`code`, `name`, `day`, `open`, `close`, `is_holiday`) values ";
				}
			}
			
			log.info("insert " + count + " records");
			sql = sql.substring(0, sql.length() - 2) + ";";
			dbInst.updateSQL(sql);
			log.info("insert finish");
		}
	}