Create a RESTful web service in Oracle Database Cloud Service

To Open the Oracle Application Express

Go to cloud.oracle.com sign in with your credentials.

20

After signing in to the cloud click on the Sign in to My Services > button, before that select your data center.

21

In the Oracle Cloud My Services tab select the businessintelldb(Database Schema). In the service details of the businessintelldb(Database Schema) Open Service Console.

 

2223

 

Step 1: Go to the Application Express of the Cloud Service. Click on the SQL workshop. Then on the RESTful Services.

 

1

2

 

Step 2: Create a module for the RESTful service module in the way as follows.

 

11

 

Step 3: Click on GET method after you see the message on top RESTful Service successfully created.

12

 

Step 4: Then you can click on the test button under the Source tab to check the RESTful service handler.When you click on Test you can see the result of the query in the source returned from the DEMO_ORDERS table from the cloud database in a new window.

 

13

Step 5: Now create a new template for retrieving the data by a particular value. Pass the URI template and /{name_of_column} i.e. the column you will select values from. This name is visible on the url when you try to access the result.

 

1415

Step 6:  After creating the template you have to create a handler of that template by the method GET. Do not forget to change the Require Service access to ‘No’. And write the query   # select * from DEMO_ORDERS where ORDER_TOTAL = :total

 

116

 

Step 7: Select the set bind variables under the Test to test the query.

17

You can set the Bind variable :total’s value to 950 as in the cloud database and click on test to check the results.

1824

In the above image you can see the data of the table DEMO_ORDERS where order total is 950.

 

Leave A Reply

Your email address will not be published. Required fields are marked *