How to connect a program developed using JavaScript with Ope

Posted by monae on 09-Nov-2016 05:25

how can we connect a program developed using javascript with openedge database

All Replies

Posted by bronco on 09-Nov-2016 06:17

From the OpenEdge perspective the most logical thing would be to develop a REST service.

Where does this Javascript run? On the server under node.js, there's a npm package called 'jdbc' which seems to give the possibility to connect to any database via JDBC. Connecting to a database from javascript in the browser: don't even think about it.

Posted by egarcia on 09-Nov-2016 11:20

Hello,

You can connect from JavaScript to the OpenEdge database (via a Business Entity running on the AppServer / PASOE).

You would build a REST service to enable the access via HTTP/HTTPS.

OpenEdge gives you several options to build REST services:

- REST where you use an editor in PDSOE to visually map the parameters in the HTTP request/response to parameters in an ABL class/procedure.

- WebHandlers where the mapping is done programmatically.

- Data Object which uses a prescriptive approach where the mapping is defined via annotations in Business Entities. This a option provides support to access using the JSDO in JavaScript.

Where is your client? Web Browser, Mobile, NodeJS?

Here are some links with examples and additional info:

- Sample programs:

   oemobiledemo.progress.com

- Mobile Workshop:

community.progress.com/.../2568.a-sexy-ui-for-progress-openedge-using-jsdo-oe-mobile-template-and-kendo-ui-with-sorting-filtering-and-paging

You can use the Web Inspector in your web browser to see the source code of the sample programs and use the Network tab to see how it would look like.

For example, the following URL returns data for the Customer table:

   oemobiledemo.progress.com/.../Customer

I hope this helps.

This thread is closed