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.
Retrieve external data using client side scripting in sharepoint
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
1 additional answer
Sort by: Most helpful
-
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.