# Configuring a Job using a tJava component

A common Job using tJava is generally composed of:

* a tFileInputDelimited component to read data from a text file,
* a tLogRow component to print data in the console,
* a tJava component to retrieve the total number of records processed.

![](https://help.qlik.com/talend/en-US/components/7.2/Resources/images/tjava_use_case1.png)

## Procedure

1. In the Palette, drag and drop a tFileInputDelimited , a tLogRow and a tJava component onto the workspace.
2. Connect tFileInputDelimited to tJava using a Trigger &gt; OnSubjobOk link.
3. Set the Basic settings of the tFileInputDelimited component.

   ![](https://help.qlik.com/talend/en-US/components/7.2/Resources/images/tjava_use_case3.png)
4. Double-click on tFileInputDelimited to display its Basic settings. In the file name/steam field, add the source data file path "C:/person.txt".
5. This file includes the following data:
   ```
   1;Shong
   2;Elisa
   3;Sabrina
   ```
6. Click the Edit Schema button and set the two-column schema.

   ![](https://help.qlik.com/talend/en-US/components/7.2/Resources/images/tjava_use_case2.png)
7. Double-click on tjava to display its Basic settings view and add the following code in the Code area:
   ```
   int nb_line=(Integer)globalMap.get("tFileInputDelimited_1_NB_LINE");
   System.out.println("The total number of records are read from the text file is: " +nb_line);
   ```
8. Execute the Job by pressing F6.

## Results

![](https://help.qlik.com/talend/en-US/components/7.2/Resources/images/tjava_use_case4.png)

The actual records from the input file are printed into the console natively. In addition, due to the use of the **tJava** component, the number of records also displays onto the console.

The actual records from the input file are printed into the console natively. In addition, due to the use of the **tJava** tJava component, the number of records also displays onto the console.