public void ReadRecordsFromDB() {

		log.info("read records from db");
		
		trans_map.clear();
		
		String sql = "select (date + 0) as date, market, code, name, opt, num, deal_price, deal_amount, deal_fee_comm," +
				"deal_fee_tax, deal_fee_other, deal_total from " + table_name;
		ResultSet rs = dbInst.selectSQL(sql);
		
		try {
			while (rs.next()) {
				TransDetailRecord record = new TransDetailRecord();
				
			    record.date 	= rs.getString("date");
			    record.market	= rs.getString("market");
			    record.code 	= rs.getString("code");
			    record.name 	= rs.getString("name");
			    record.opt		= rs.getInt("opt");
			    record.num		= rs.getInt("num");
			    record.deal_price		= rs.getDouble("deal_price");
			    record.deal_amount		= rs.getDouble("deal_amount");
			    record.deal_fee_comm	= rs.getDouble("deal_fee_comm");
			    record.deal_fee_tax		= rs.getDouble("deal_fee_tax");
			    record.deal_fee_other	= rs.getDouble("deal_fee_other");
			    record.deal_total		= rs.getDouble("deal_total");
				
				ArrayList<TransDetailRecord> list;
				String key = record.market + "\005" + record.code;
				list	= trans_map.get(key);
				if (list == null) {
					list = new ArrayList<TransDetailRecord>();
				}
				list.add(record);
				trans_map.put(key, list);
			}
		} catch (Exception e) {
			log.error("sql excute failed! sql:" + sql, e);
			System.exit(0);
		}
		
		DateComparator comp = new DateComparator();
		for (String key : trans_map.keySet().toArray(new String[0])) {
			ArrayList<TransDetailRecord> list = trans_map.get(key);
			Collections.sort(list, comp);
		}
	}