17.3.5 Example: Creating REST Enabled SQL Service Reference on MySQL

Review an example of creating a REST Enabled SQL service reference on a remote MySQL database.

The following example builds a fictional REST Enabled SQL service reference named MySQL REST Enabled SQL Example using the Base URL http://server.example.com:8080/ords/mysqldb.

Tip:

Before creating a REST enabled SQL reference, developers must complete the requirements described in Before You Begin: REST Enabled SQL Service Requirements.

To create a REST Enabled SQL service reference to a MySQL database:

  1. Navigate to the REST Enabled SQL page:
    1. On the Workspace home page, click App Builder.
    2. Select an existing application.
    3. On the Application home page, click Shared Components in the center of the page.
    4. Under Data Sources (bottom left of the page) select REST Enabled SQL.
  2. On the REST Enabled SQL page, click Create.
  3. For General:
    1. Name - Enter a descriptive name for this REST Enabled SQL service. For example:

      MySQL REST Enabled SQL Example

    2. Endpoint URL - Enter the base URL for this REST Enabled SQL service. For example:
    3. Click Next.
  4. For Authentication:
    1. Credentials - Select an existing credential to authenticate against. For example: To create new credentials, select Enter New.
    2. Credential Name - Enter a descriptive name for the credentials. For example:

      Credentials for MySQL REST Enabled SQL Example

    3. Store Credentials - Accept the default, enabled. When disabled, the named credential is created, with empty values stored as Username and Password. To use the REST Enabled SQL Reference, credentials must be set for the APEX Session, with the APEX_CREDENTIAL.SET_SESSION_CREDENTIALS procedure.
    4. Username - For Basic Authentication, enter the database user name.

      Tip:

      Since MySQL user names are most often in lower case, enable the Case Sensitive User Name attribute.
    5. Password - Enter the password. This information is stored encrypted and cannot be retrieved in clear text.
    6. Verify Password - Enter the password again to verify your input.
    7. Case Sensitive User Name - Enable this switch to store a case-sensitive User Name. Otherwise the user name will be converted to upper case. While user names are typically in upper case on Oracle databases, MySQL user names are most often in lower case.
  5. Click Create.

    APEX tests the REST Enabled SQL service. If everything has been done correctly (that is, you have included the correct URL, schema name, and password), the Test REST Enabled SQL Service message appears as shown in the following image.

    Description of test_rest_enabled_ref_mysql.png follows
    Description of the illustration test_rest_enabled_ref_mysql.png
  6. Set Default Database -
    1. From Default Database list, select the database to use for operations on this MySQL REST Enabled SQL Reference.
    2. Click Set Default Database.
  7. Click Close.
The REST Enabled SQL service reference appears on the REST Enabled SQL page.