Use Links to Access Oracle Database Cloud Service

Use links to accessOracle Database Cloud Service. You can read or store historical data, data from your Enterprise Resource Planning (ERP) system, or summary data. Then you can access Oracle Database as a Service links from your analytics processors to retrieve data to contextualize the data gathered from sensors and devices.

Before configuring a link to read or write to Oracle Database Cloud Service, you need the following items:
  • Access to an Oracle Database Cloud Service instance: you need a JDBC connection string, a user name and a password.

    A JDBC connection string has the following format: jdbc:oracle:thin@db-host-name:db-port:db-service-name.

  • An analytics object to store the data that your read or write toOracle Database Cloud Service.

    Note:

    When you define your analytics object follow these rules:

    • The name of the fields in the analytics objects must be all uppercase letters.

    • The fields that correspond to columns formatted as numbers must be of type double.

    Otherwise the analytics object that you read from the link won’t be initialized.
  1. Go to your IoT application, select Analytics, and then select Links.
  2. Create the link:
    1. If this is your first link, click Create Link. Otherwise, click Add next to the Search field.
    2. Enter a name to identify your link.
      The name must only contain alphanumeric characters and must not contain spaces.
    3. (Optional) Enter a brief description.
    4. Click Create.
  3. From the Type list, select Oracle Database as a Service.
    The properties below the Type list change.
  4. From the Analytics Object list, select an analytics object to store the result of the query.
    The structure of your analytics object must match the structure of the rows in your table.
  5. In the Connection String field, enter the JDBC connection string to accessOracle Database Cloud Service.
    If you have a subscription to Oracle Database Cloud Service, you can access it from the My Services console. To find the connection details to connect to your database instance, log in to the Oracle Database Cloud Service console and click the database you want to use.

    A JDBC connection string has the following format: jdbc:oracle:thin@db-host-name:db-port:db-service-name.

  6. In the Table Name field, enter the name of the table you want to access.
  7. In the Username field, enter the user name to access Oracle Database Cloud Service.
  8. In the Password field, enter the password for the user name you provided in the previous step.
  9. (Optional) Select Use from Worksheets to be able to query this link from the queries in your worksheets.
    If you select this option, then you can use this link in the from clause of your query.
    For example:
    select * from MyLink
  10. Click Save.
  • If you add this link to your analytics processor and generate the source template, the source template will include a line of code that injects this link into your analytics processor.

  • If you selected Use from Worksheets, you can use this link in the from clause of the queries in your worksheets.