but as this is for older version of AEM, this was not helpful and i didn't able to save data in the JCR.
by the above link what is clear to me is we have to save all the fields of customer as a property in the JCR node ,
but how to call this service which they have defined is not clear to me.
I have implemented a component which as all the fields shown in example and i have called the simpleservlet using ajax call and i have all the field data in this servlet but dont know what should be next step to call this service and save data in JCR.
You can refer to the below helpx article (AEM version: Adobe Experience Manager 6.x).
The aim of the below article is to store customer data in JCR and then retrieve the content which is stored in JCR by triggering the queries. The results of the query will be displayed on the web page in the form of grid table as shown in the below article.
In the below helpx article, search for injestCustData method. This method is responsible for storing customer data in the AEM JCR.