Retrieve external data using client side scripting in sharepoint

venkatesh padmanabhan 181 Reputation points
2020-08-20T06:37:28.41+00:00

Hi. I have a sharepoint 2016 site. I would like to retieve data from SQL/Oracle database and show the datatable information as a table in a webpart page.

I do not have options to create a visual studio code, BCS. Is there an option to use the Javascript client object model to retrieve the external data information ? If yes, is there any code references for the same.

Thanks

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,621 questions
0 comments No comments
{count} votes

Accepted answer
  1. Trevor Seward 11,706 Reputation points
    2020-08-20T16:15:39.307+00:00

    JavaScript doesn't work outside of the sphere of the web. You need to have a middle tier that can talk to Oracle/SQL. This middle tier can have a web service endpoint where your client-side code can talk to.


1 additional answer

Sort by: Most helpful
  1. Amos Wu-MSFT 4,051 Reputation points
    2020-08-21T02:33:48.05+00:00

    It is not a good choice to use JavaScript to retrieve data from database.Even if it works,it would expose the database user name and password on the client.
    As @Trevor Seward said,you need to develop a middleware(like web service) to retrieve data from database,then you could use JavaScript to call your middleware to get the value.


    If the response is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.