In order to import the data you receive, you need to understand the format of the file you configure.
The file consists of two record formats: one for the customer and one for the transactions. Listing 10-5
shows a sample of the file format.
Listing 10-5. Sample of the customerTransaction.csv File
This sample consists of the records for a single customer. The file you process for the example
contains records for many customers. The initial customer record consists of eight fields:
Social Security number : This tax id number is unique for each customer. Although
it isn't the primary key for the Customer table, it can be used to look up unique
First name: The customer's first name.
Last name: The customer's last name.
Address: The customer's street address.
City: The city the customer lives in.
State: The state the customer lives in.
Zip code: The postal code for the customer.
• Account number: The identifying number for the customer's account.
It's important to note that for processing purposes, the customers you process already exist in your
database. This file is only used to update existing customers and accounts. Any record for a customer
who doesn't exist (identified by their Social Security number) is invalid.
The records after a customer record and before the next customer record are the transaction records
for the customer preceding them. Each transaction record consists of five fields:
Account number : The account number the transaction belongs to. This should
match the account number of the previous customer record.
Stock ticker: The stock symbol for this transaction. This is used later to obtain the
current price for the stock.
Price: The price of the stock when it was traded.
Quantity: The number of shares traded. Positive numbers mean the shares were
purchased; negative numbers indicate they were sold.
Timestamp: The date and time when the transaction was executed.
To process this file, you begin by defining the job and its first step. The job configuration, like all the
job configurations you've done in this topic, is located in the statement/src/main/resources/jobs