cancel
Showing results for 
Search instead for 
Did you mean: 

how to connect to oracle db from UI5 project

govardan_raj
Contributor
0 Kudos

Hi ,

our back end is oracle database , usually we use jdbc connectors and connect to oracle db and fetch data and process etc , in UI5 application can anyone explain how to connect to oracle database .

our ui5 appilcation developed has a view which is based on  java script controller .

Regards

Govardan Raj S

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

eventhough it says hana cloud, it uses jpa and olingo, which is applicable for oracle

govardan_raj
Contributor
0 Kudos

hi maksim,

thanks for the reply will update once done with..

Regards

Govardan

Answers (2)

Answers (2)

varun_boyina
Participant
0 Kudos

This message was moderated.

former_member182374
Active Contributor
0 Kudos

Hi,

You can write a java servlet.


In the java servlet write your jdbc code and return it to the client formatted as JSON (there are many JSON packages for java).

In the client (SAPUI5) side create a JSON model and call the servlet.

Regards,
Omri

govardan_raj
Contributor
0 Kudos

hi omri ,

thanks for the reply

govardan_raj
Contributor
0 Kudos

hi Omri,

i created a local java file first , in which in connecting to oracle database and also using json jar file im creating json object i.e created a method that returns json object with data from odb, and now how can i access this json object in the controller ? Im new to UI5 pleaes suggest a solution..

Regards

Govardan Raj

former_member182374
Active Contributor
0 Kudos

Hi,

You should use a java servlet and not local file (you should do it on the server).

In the SAPUI5 you should use JSON model:

var oModel = new sap.ui.model.json.JSONModel();

oModel.loadData('http://your_j2ee/your_servlet);

Regards,

Omri