2022

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

     6. The log shows a successful deployment. Now let us configure the properties for Java Connector. In our case the only property which we need to set is the environment name setting in the classpath property.
     So we need to set it to "sandbox".
     7.The log shows a successful deployment. Now let us configure the properties for Java Connector. In our case the only property which we need to set is the environment name setting in the classpath property. So          we need to set it to "sandbox".
     8. Similarly for db adapter set the connection and db properties to be used while sync,Now let us go ahead and configure our use-case, we need to configure the db adapter to be able to read from the db table and          write it out in our Hello World program Before we can use the connectors in our project, we need to validate them.
     9. Now define and save the reader ( dbreader) properties by using the metadata exposed through the Lookup button .Let us define the sql query which we will be using to fetch data from the selected table. In this             case we use the following query: "select * from test_customer"

Wiki Markup
Note

In this example we are using the AppCode as a writer and not a reader. However, as explained in the previous sections, we can use the AppCode as a source as well from where we do a read operation. In that case, we need to pass a SELECT statement as an input query which would be converted into a filter. The filter params are passed in the where condition as key='value' comma separated. The structure of the same is given below:
 select * from <tablename> where <filterkey>='<filtervalue>',<filterkey2>=’<filtervalue2>’SaveResult[] <methodName>(List<InputMetadataParameter> ) 
 :&nbsp;
_In this example we are using the AppCode as a writer and not a reader. However, as explained in the previous sections, we can use the AppCode as a source as well from where we do a_&nbsp;*{_}read{_}*&nbsp;_operation. In that case, we need to pass a SELECT statement as an input query which would be converted into a filter. The filter params are passed in the where condition as key='value' comma separated. The structure of the same is given below:_
&nbsp;select * from <tablename> where []SaveResult\[\] <methodName>(List<InputMetadataParameter> )&nbsp;

We set the batchSize to 100 and the table name to "writeHello" which we defined in our HelloWorld AppCode in this example 
After selecting the table and saving the properties, we need to map the reader and the writer properties
For that open the properties of the Map box and set them. We need to define the map sequence and the description
In this case, we set Map Sequence as 1 and the description as "Test" 

Now let us edit the Map where we map out the Reader metadata elements to that of the Writer
we need to select the fields from the Source and Target and map them out respective from the Map Screen.To get more details about the whole process of Mapping you can go through WIKI documentation in the DBSync section section .Now as per the mapping, we have mapped the "id" field in the Writer to the "number" field in the Reader and the "name" field of the Writer to the "name" field of the "Reader
After "closing" the Map window, we go back to the properties window of the "Map" state and "Save" it.On successful "Save", we need to now run the Sync and view the results. For that, click on the "run" button
However before we click on run, we need to ensure the LogLevel is SET properly.

Now let us click on the "Run button" and on clicking the section changes to the Runnin view. Click on the "Processes" tab to view the logs and click on the individual logfile in the list to view it in the LogViewer 

On Successful run, we can view the output. 

The "Writer" output in the console looks something like this:

Code Block

 Received input parameter:id:C02710:name:Name07_Updated
Writing value:Hello:Name07_Updated:a93d1c72-4b4b-43aa-af42-5c9d27629b0e
Received input parameter:id:C02720:name:Name08_Updated
Writing value:Hello:Name08_Updated:a93d1c72-4b4b-43aa-af42-5c9d27629b0e
Received input parameter:id:C02730:name:Cronus Cardoxy Sales
Writing value:Hello:Cronus Cardoxy Sales:a93d1c72-4b4b-43aa-af42-5c9d27629b0e
Received input parameter:id:C02740:name:Cronus Cardoxy Procurement
Writing value:Hello:Cronus Cardoxy Procurement:a93d1c72-4b4b-43aa-af42-5c9d27629b0e
Received input parameter:id:IC1020:name:Cronus Cardoxy Sales
Writing value:Hello:Cronus Cardoxy Sales:a93d1c72-4b4b-43aa-af42-5c9d27629b0e
Received input parameter:id:IC1030:name:Cronus Cardoxy Procurement
Writing value:Hello:Cronus Cardoxy Procurement:a93d1c72-4b4b-43aa-af42-5c9d27629b0e
Hello World AppCode close called:a93d1c72-4b4b-43aa-af42-5c9d27629b0e