public class Standard extends StatementHelper implements Operations
This standard implementation is based upon the sample programs in the appendix of the TPC-C specification.
More specific direct (client side) implementations could extend this class overriding methods as needed.
Object is single threaded so it re-uses objects where possible to avoid the garbage collection due to the application affecting the results too much since the purpose of the framework is to test Derby's performance.
Modifier and Type | Field and Description |
---|---|
private Customer |
customer |
private District |
district |
private java.util.List<java.lang.Object> |
nameList |
private Order |
order |
private static java.lang.String[] |
STOCK_INFO |
private Warehouse |
warehouse |
conn
Constructor and Description |
---|
Standard(java.sql.Connection conn)
Create an instance of this implementation.
|
Modifier and Type | Method and Description |
---|---|
void |
delivery()
Execute a single delivery from the FIFO queue.
|
private void |
getOrderStatusForCustomer(Display display,
java.lang.Object displayData,
boolean byName,
Customer customer)
Fetch the order details having obtained the customer information
and display it.
|
void |
newOrder(Display display,
java.lang.Object displayData,
short w,
short d,
int c,
int[] items,
short[] quantities,
short[] supplyW)
Execute new order.
|
static Operations |
noReset(java.sql.Connection conn)
Return an Operations implementation based upon
Standard with a single difference.
|
void |
orderStatus(Display display,
java.lang.Object displayData,
short w,
short d,
int c)
Order status by customer identifier.
|
void |
orderStatus(Display display,
java.lang.Object displayData,
short w,
short d,
java.lang.String customerLast)
Order status by customer last name.
|
void |
payment(Display display,
java.lang.Object displayData,
short w,
short d,
short cw,
short cd,
int c,
java.lang.String amount)
Payment by customer identifier.
|
void |
payment(Display display,
java.lang.Object displayData,
short w,
short d,
short cw,
short cd,
java.lang.String customerLast,
java.lang.String amount)
Payment by customer last name.
|
private void |
paymentById(Display display,
java.lang.Object displayData,
short w,
short d,
short cw,
short cd,
int c,
java.lang.String amount) |
void |
scheduleDelivery(Display display,
java.lang.Object displayData,
short w,
short carrier)
Schedule a delivery using the database as the queuing
mechanism and the results file.
|
void |
sortOrderItems(int[] items,
short[] quantities,
short[] supplyW) |
void |
stockLevel(Display display,
java.lang.Object displayData,
short w,
short d,
int threshold)
Stock Level transaction.
|
close, getAddress, getAddress, prepareStatement, reset
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
private final Customer customer
private final Warehouse warehouse
private final District district
private final Order order
private final java.util.List<java.lang.Object> nameList
private static final java.lang.String[] STOCK_INFO
public Standard(java.sql.Connection conn) throws java.sql.SQLException
java.sql.SQLException
public static Operations noReset(java.sql.Connection conn) throws java.sql.SQLException
Each ResultSet will be closed implicitly either at commit time or at the next execution of the same PreparedStatement object.
java.sql.SQLException
public void stockLevel(Display display, java.lang.Object displayData, short w, short d, int threshold) throws java.lang.Exception
stockLevel
in interface Operations
display
- Where to display the results, if null results are not
displayed.displayData
- Any client specific display information, such as servlet
context.w
- Warehouse for transactiond
- District for transactionthreshold
- Threshold for transaction.java.lang.Exception
Display.displayStockLevel(Object, short, short, int, int)
public void orderStatus(Display display, java.lang.Object displayData, short w, short d, java.lang.String customerLast) throws java.lang.Exception
orderStatus
in interface Operations
display
- Where to display the results, if null results are not
displayed.displayData
- Any client specific display information, such as servlet
context.w
- Warehouse identifierd
- District identifiercustomerLast
- Customer's last name.java.lang.Exception
public void orderStatus(Display display, java.lang.Object displayData, short w, short d, int c) throws java.lang.Exception
orderStatus
in interface Operations
display
- Where to display the results, if null results are not
displayed.displayData
- Any client specific display information, such as servlet
context.w
- Warehouse identifierd
- District identifierc
- Customer identifer.java.lang.Exception
private void getOrderStatusForCustomer(Display display, java.lang.Object displayData, boolean byName, Customer customer) throws java.lang.Exception
java.lang.Exception
public void payment(Display display, java.lang.Object displayData, short w, short d, short cw, short cd, java.lang.String customerLast, java.lang.String amount) throws java.lang.Exception
payment
in interface Operations
display
- Where to display the results, if null results are not
displayed.displayData
- Any client specific display information, such as servlet
context.w
- Home warehouse identifierd
- Home district identifiercw
- Customer warehouse identifiercd
- Customer district identifiercustomerLast
- Customer's last name.amount
- Payment amountjava.lang.Exception
public void payment(Display display, java.lang.Object displayData, short w, short d, short cw, short cd, int c, java.lang.String amount) throws java.lang.Exception
payment
in interface Operations
display
- Where to display the results, if null results are not
displayed.displayData
- Any client specific display information, such as servlet
context.w
- Home warehouse identifierd
- Home district identifiercw
- Customer warehouse identifiercd
- Customer district identifierc
- Customer identifer.amount
- Payment amountjava.lang.Exception
private void paymentById(Display display, java.lang.Object displayData, short w, short d, short cw, short cd, int c, java.lang.String amount) throws java.lang.Exception
java.lang.Exception
public void newOrder(Display display, java.lang.Object displayData, short w, short d, int c, int[] items, short[] quantities, short[] supplyW) throws java.lang.Exception
Operations
Assumption is that items.length == quanties.length == supplyW.length.
newOrder
in interface Operations
display
- Where to display the results, if null results are not
displayed.displayData
- Client specific display information, such as servlet
context.w
- Warehouse identifierd
- District identifierc
- Customer identifieritems
- array of item numbersquantities
- quanties for each itemsupplyW
- Supply warehouse for each item.java.lang.Exception
public void scheduleDelivery(Display display, java.lang.Object displayData, short w, short carrier) throws java.lang.Exception
scheduleDelivery
in interface Operations
display
- Where to display the results, if null results are not
displayed.displayData
- Any client specific display information, such as servlet
context.w
- Warehouse identifiercarrier
- Carrier identifierjava.lang.Exception
public void delivery() throws java.lang.Exception
Operations
delivery
in interface Operations
java.lang.Exception
public void sortOrderItems(int[] items, short[] quantities, short[] supplyW)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.