Basic load example
Goal
The goal is to load the first two columns of theTrades table into the Trades store.
Table content
| ID | AMOUNT | CURRENCY | TRADER | TRADER_ENTITY | BANK |
|---|---|---|---|---|---|
| 1 | 12394 | chf | E F | E3 | BNP Paribas |
| 2 | 13149 | gbp | A B | E4 | BNP Paribas |
Trades content
We want to load the first two columns into Trades store.
| id | amount |
|---|---|
| 1 | 12394 |
| 2 | 13149 |
Setup
First, we need to import the artifactcom.activeviam.source:jdbc-source in our project.
Build a source
In order to load data from a database into a datastore, the first step is to build a JDBC source.Load into datastore
The second step is to create a channel and use the source to fetch the data into the Datastore.A channel is the link between a topic and a store.
The way to do so is to provide a channel factory to the source.
There is two ways of doing so. Using the fetch utility: