Forum Discussion

sismail786's avatar
8 years ago

How to connect to Third Party database directly in Lithium without REST API?

Hi, 

 

I want to connect to third party database without using REST Api for storing and fetching data. Can somebody help me in this if there is anyway to do so.

 

Thanks in advance.

 

- Deepak

  • sismail786- There is no other way to fetch or store data from third party sever without using REST API's .

     

    To achieve this in lithium you need to create an endpoint and use http.client.request for the calls. You can get more info about the http.client.request here.

    The other way to do this , directly hit a  jQuery Ajax call to the third party server.

     

    Tariq

    Give kudos if you find my posts helpful or mark solution if it answers your query.

  • sismail786 - If you want to do some data transactions, there's going to be a way to do it. Is there a reason you don't want to use the APIs? More context on this would be helpful.

     

    • sismail786's avatar
      sismail786
      Guide

      VarunGrazitti Thanks for the reply.

       

      I have to interact with Third party database for storing and fetching data regarding some services. This data is completely new in DB and a new table will be created for this. Now as per discussion forum, for storing and fetching data from this new table, I have to write external REST APIs and then use these APIs in Lithium endpoint to display information in custom component using Ajax. 

      I was wondering if there is any way to directly connect to database without writing these external APIs so as to fetch data to component and store updated data from component to DB. So can you please help me if there is any way to do so.

      I am new to this so it would be great if you can provide some example.

       

      Thanks in Advance.  - Deepak

       

       

       

       

      • sismail786's avatar
        sismail786
        Guide

        VarunGrazitti can you help me out on this.

         

        I need to interact with Third party DB tables without using API. Can you help me if this is possible. Can you share a sample example or link where I could follow.

         

        Thanks in advance - Deepak