cancel
Showing results for 
Search instead for 
Did you mean: 

Using external database (CosmosDB) in BAS SAPUI5 project

planteksz
Explorer
0 Kudos
209

Hi everyone,

I have an UI5 application on Business Application Studio where I have some data the user can enter on a form. I would like to save this data in my CosmosDB SQL database. I searched around a lot but I can't seem to find a good solution for this. Does anyone have tips about how could I connect to my database to read/write data from it? I was trying with OData but I have issues with authorization - how could I manage that?

Accepted Solutions (1)

Accepted Solutions (1)

mariusobert
Developer Advocate
Developer Advocate

Hi Szilvia,

SAPUI5 apps are client apps which means they run in the browsers of the user. To store data in any db, you need a server component in between to take care of authentication, validation etc. This server component can then use drivers/modules to connect to Cosmos and could run in SAP Cloud Platform. Here's a connector package for Node.js apps but there are also similar ones for Java etc.

In case you want to build an OData service, it is probably easiest to leverage CAP (Cloud Application Programming Model) and SAP HANA to bootstrap such a service with very little work.

Answers (0)