Access Data in an Existing Oracle Database Using ORDS
If you're looking to expose data from existing Oracle databases, you can use your own database schema to create business objects in VB Studio. You can also connect to Oracle REST Data Services (ORDS), which makes it easy to expose your tables and other database objects as REST services.
To expose your data through ORDS, you must first enable ORDS access for tables and views in the schema associated with your database connection. If you're using Oracle SQL Developer, you can enable REST access either to the schema or to the individual table or view. See Automatically Enabling REST Access to a Schema, Table, or View (AutoREST) in Oracle SQL Developer User's Guide for more information.
Note:
If your database is in a private subnet or behind a firewall, your ORDS endpoint must have a public IP address to be accessible by VB Studio.Map ORDS Endpoints in VB Studio
When your database table or view is REST-enabled, you can use either the individual endpoint or the OpenAPI catalog to map the ORDS endpoint as a REST service in your application.
- To map the individual endpoint, you need the endpoint URL, which may be something like
https://serverName/ords/schemaName/tableName/
. Now create a service connection from this endpoint. You may need to define multiple endpoints that map to each REST operation (GET, POST, DELETE, etc.) - To map the OpenAPI specification, which allows you to create many endpoints all at once, add
open-api-catalog
to the object's URL, which may be something likehttps://serverName/ords/schemaName/open-api-catalog/tableName/
. Now create a service connection using the OpenAPI specification. See this blog for a demo.
Note:
Make sure CORS settings for the ORDS endpoint and the service connection match; in other words, both ORDS and VB Studio must have CORS enabled, or neither must have CORS enabled. For an example of how to configure an ORDS endpoint to support CORS, see About Browser Origins in ORDS documentation.Sort, Query, and Paginate ORDS Data
Connect to ORDS APIs Using Fixed Credentials
To secure access to the ORDS endpoint using fixed credentials, you use OAuth 2.0 Client Credentials for authentication.
Authentication method | Details |
---|---|
OAuth 2.0 Client Credentials |
This is the recommended authentication option. To use this option you need to provide the following details:
|
- Before creating a connection to ORDS, a role and privilege to protect your REST service must be created and the OAuth client must be registered in the ORDS service. The following steps briefly describe this process; for detailed information, see Protecting and Accessing Resources in Developing Oracle REST Data Services Applications.
- Now create a connection to ORDS using fixed credentials: