How to process source data (e.g. JSON RESTful web services, excel files, etc)

The input data we need to process can come from JSON RESTful web service and excel files. We are now going to see how to process these data.Back

JSON RESTful:

  • We are going to use the JSON API to process the json objects
  • Store the URL which contains the JSON data
  • Create a json array to store all the data from the JSON object
  • Use an Iterator to traverse through each record

Excel Files:

  • We have inbuilt libraries to process excel files. We are going to use the Apache POI API to process the excel files.
  • Use the FileInputStream class to read the byte oriented data. Pass the file name as the parameter.
  • Then, create the workbook object which is the first object we need to create when reading or writing a new excel file.
  • Create a sheet object which is the central structure within a workbook and get the worksheet which you want to read from the file using the worksheet number
  • Use a row iterator to traverse through each row in the sheet

Go back to Development with web services – Training