src/main/java/org/vanilladb/bench/server/procedure/tpce/TradeOrderProc.java
private void frame4() {
		long currentTime = System.currentTimeMillis();
		
		// XXX: Lots of dummy value
		// Record trade information in TRADE table.
		// INSERT INTO trade (t_id, t_dts, t_st_id, t_tt_id, t_is_cash,
		// t_s_symb, t_qty, t_bid_price, t_ca_id, t_exec_name, t_trade_price,
		// t_chrg, t_comm, t_tax, t_lifo) VALUES (...)
		String sql = String.format("INSERT INTO trade (t_id, t_dts, t_st_id, t_tt_id, "
				+ "t_is_cash, t_s_symb, t_qty, t_bid_price, t_ca_id, t_exec_name, "
				+ "t_trade_price, t_chrg, t_comm, t_tax, t_lifo) VALUES (%d, %d, '%s', "
				+ "'%s', %d, '%s', %d, %f, %d, '%s', %f, %f, %f, %f, %d)",
				paramHelper.getTradeId(), currentTime, statusId, 
				paramHelper.getTradeTypeId(), 1, paramHelper.getSymbol(),
				paramHelper.getTradeQty(), marketPrice, paramHelper.getAcctId(), "exec_name",
				paramHelper.getTradePrice(), 0.0, 0.0, 0.0, 1);
		executeUpdate(sql);
		
		// TODO: Implement this (not in the simplified version)
		// Record pending trade information in TRADE_REQUEST table 
		// if this trade is a limit trade
		// INSERT INTO trade_request (tr_t_id, tr_tt_id, tr_s_symb, tr_qty,
		// tr_bid_price, tr_b_id) VALUES (...)
		
		// Record trade information in TRADE_HISTORY table
		// INSERT INTO trade_history (th_t_id, th_dts, th_st_id) VALUES (...)
		sql = String.format("INSERT INTO trade_history (th_t_id, th_dts, th_st_id) VALUES "
				+ "(%d, %d, '%s')",  paramHelper.getTradeId(), currentTime, statusId);
		executeUpdate(sql);
	}
private void frame4() {
		long currentTime = System.currentTimeMillis();
		
		// XXX: Lots of dummy value
		// Record trade information in TRADE table.
		// INSERT INTO trade (t_id, t_dts, t_st_id, t_tt_id, t_is_cash,
		// t_s_symb, t_qty, t_bid_price, t_ca_id, t_exec_name, t_trade_price,
		// t_chrg, t_comm, t_tax, t_lifo) VALUES (...)
		String sql = String.format("INSERT INTO trade (t_id, t_dts, t_st_id, t_tt_id, "
				+ "t_is_cash, t_s_symb, t_qty, t_bid_price, t_ca_id, t_exec_name, "
				+ "t_trade_price, t_chrg, t_comm, t_tax, t_lifo) VALUES (%d, %d, '%s', "
				+ "'%s', %d, '%s', %d, %f, %d, '%s', %f, %f, %f, %f, %d)",
				paramHelper.getTradeId(), currentTime, statusId, 
				paramHelper.getTradeTypeId(), 1, paramHelper.getSymbol(),
				paramHelper.getTradeQty(), marketPrice, paramHelper.getAcctId(), "exec_name",
				paramHelper.getTradePrice(), 0.0, 0.0, 0.0, 1);
		executeUpdate(sql);
		
		// TODO: Implement this (not in the simplified version)
		// Record pending trade information in TRADE_REQUEST table 
		// if this trade is a limit trade
		// INSERT INTO trade_request (tr_t_id, tr_tt_id, tr_s_symb, tr_qty,
		// tr_bid_price, tr_b_id) VALUES (...)
		
		// Record trade information in TRADE_HISTORY table
		// INSERT INTO trade_history (th_t_id, th_dts, th_st_id) VALUES (...)
		sql = String.format("INSERT INTO trade_history (th_t_id, th_dts, th_st_id) VALUES "
				+ "(%d, %d, '%s')",  paramHelper.getTradeId(), currentTime, statusId);
		executeUpdate(sql);
	}
private void frame4 ( ) { long currentTime = System . currentTimeMillis ( ) ; // XXX: Lots of dummy value
 // Record trade information in TRADE table.
 // INSERT INTO trade (t_id, t_dts, t_st_id, t_tt_id, t_is_cash,
 // t_s_symb, t_qty, t_bid_price, t_ca_id, t_exec_name, t_trade_price,
 // t_chrg, t_comm, t_tax, t_lifo) VALUES (...)
 String sql = String . format ( "INSERT INTO trade (t_id, t_dts, t_st_id, t_tt_id, " + "t_is_cash, t_s_symb, t_qty, t_bid_price, t_ca_id, t_exec_name, " + "t_trade_price, t_chrg, t_comm, t_tax, t_lifo) VALUES (%d, %d, '%s', " + "'%s', %d, '%s', %d, %f, %d, '%s', %f, %f, %f, %f, %d)" , paramHelper . getTradeId ( ) , currentTime , statusId , paramHelper . getTradeTypeId ( ) , 1 , paramHelper . getSymbol ( ) , paramHelper . getTradeQty ( ) , marketPrice , paramHelper . getAcctId ( ) , "exec_name" , paramHelper . getTradePrice ( ) , 0.0 , 0.0 , 0.0 , 1 ) ; executeUpdate ( sql ) ; // TODO: Implement this (not in the simplified version)
 // Record pending trade information in TRADE_REQUEST table 
 // if this trade is a limit trade
 // INSERT INTO trade_request (tr_t_id, tr_tt_id, tr_s_symb, tr_qty,
 // tr_bid_price, tr_b_id) VALUES (...)
 // Record trade information in TRADE_HISTORY table
 // INSERT INTO trade_history (th_t_id, th_dts, th_st_id) VALUES (...)
 sql = String . format ( "INSERT INTO trade_history (th_t_id, th_dts, th_st_id) VALUES " + "(%d, %d, '%s')" , paramHelper . getTradeId ( ) , currentTime , statusId ) ; executeUpdate ( sql ) ; }
Record the trade request by making all related updates
Record the trade request by making all related updates