public static void updateRecords(List<HistoryRecord> records) throws SQLException {
		if( records.isEmpty() ) return;
		
		StringBuilder deleteSQL = new StringBuilder();
		deleteSQL.append("delete from HistoryData where symbol = '").append(records.get(0).getSymbol()) 
				.append("' and date in (");
		boolean first = true;
		for( HistoryRecord r : records ) {
			if( !first ) {
				deleteSQL.append(",");
			}
			deleteSQL.append("'").append(Utils.formatDate(r.getDate())).append("'");
			first = false;
		}
		deleteSQL.append(")");
		
		StringBuilder insertSQL = new StringBuilder();
		first = true;
		insertSQL.append("insert into HistoryData(symbol, date, high, low, open, close, adjclose, volume) values");
		for( HistoryRecord r : records ) {
			if( !first ) {
				insertSQL.append(",");
			}
			insertSQL.append("('").append(r.getSymbol()).append("',");
			insertSQL.append("'").append(Utils.formatDate(r.getDate())).append("',");
			insertSQL.append(r.getHigh()).append(",");
			insertSQL.append(r.getLow()).append(",");
			insertSQL.append(r.getOpen()).append(",");
			insertSQL.append(r.getClose()).append(",");
			insertSQL.append(r.getAdjClose()).append(",");
			insertSQL.append(r.getVolume()).append(")");
			first = false;
		}
		
		Connection c = null;
		try {
			c = Utils.getConnection();
			PreparedStatement stmt = c.prepareStatement(deleteSQL.toString());
			stmt.executeUpdate();
			stmt = c.prepareStatement(insertSQL.toString());
			stmt.executeUpdate();
		} finally {
			if( c != null ) {
				try { c.close(); } catch( SQLException e ) {}
			}
		}
	}