Using IntelliJ Plugin for Development

Browse tables and execute queries on your Oracle NoSQL Database Cloud Service instance or simulator from IntelliJ.

The Oracle NoSQL Database Cloud Service IntelliJ plugin connects to a running instance of Oracle NoSQL Database Cloud Service or simulator and allows you to:
  • Quickly get started with Oracle NoSQL Database Cloud Service by using the examples available with the plugin.
  • View the tables in your cloud account or simulator.
  • Retrieve columns, indexes, primary keys, and shard keys for each table.
  • Build and test your SQL queries on a table and obtain results in a tabular format.
  • View the data in each column in the JSON format.

This article has the following topics:

Setting Up IntelliJ Plug-in

Learn how to set up the IntelliJ plug-in for Oracle NoSQL Database Cloud Service instance or simulator.

Perform the following steps:
  1. Download and start Oracle NoSQL Database Cloud Simulator. See Downloading the Oracle NoSQL Database Cloud Simulator.
  2. Download and extract Oracle NoSQL Database Java SDK. See About Oracle NoSQL Database SDK drivers.
  3. Install the IntelliJ plugin, and restart the IDE.
    You have two options to install the plugin:

    Tip:

    Don't extract the downloaded plugin zip file. Select the plugin in the zip format while installing it from disk.
After you successfully set up your IntelliJ plugin, create a NoSQL project, and connect it to your Oracle NoSQL Database Cloud Service instance or simulator.

Creating a NoSQL Project in IntelliJ

Learn how to create a NoSQL project in IntelliJ.

Perform the following steps:
  1. Open IntelliJ IDEA. Click File > New > Project.
  2. Select Oracle NoSQL examples from the explorer window, and click Next.
  3. Browse to the location where you extracted Oracle NoSQL Database Java SDK on your hard-disk, and click OK.
    For example, if you extracted the Oracle NoSQL Database Java SDK in your D:\ drive, the path looks like D:\oracle-nosql-java-sdk-5.2.11
  4. Click Next.
  5. Enter a value for Project Name and Project Location, and click Finish.
  6. Once your NoSQL project is created, you can browse the example java files from the Project Explorer window.
After you successfully create a NoSQL project in IntelliJ, connect your project to your Oracle NoSQL Database Cloud Service or simulator.

Connecting to Oracle NoSQL Database Cloud Service from IntelliJ

Learn how to connect your NoSQL project to Oracle NoSQL Database Cloud Service using the IntelliJ plugin

Perform the following steps:
  1. Open your NoSQL project in IntelliJ.
  2. Click the Settings icon icon in the Schema Explorer window to open the Settings dialog for the plugin.
  3. Expand Tools > Oracle NoSQL in the Settings Explorer, and click Connections.
  4. Select Cloud from the drop-down menu for the connection type.
  5. Enter values for the following connection parameters, and click OK.

    Table 5-1 Connection Parameters

    Parameter Description Sample Value
    Endpoint Regional network access point to the Oracle NoSQL Database Cloud Service. https://nosql.us-ashburn-1.oci.oraclecloud.com (for the Ashburn Oracle NoSQL Database Cloud Service region identifier in the North America region. See Data Regions and Associated Service Endpoints for a list of service endpoints.
    SDK Path Complete path to the directory where you extracted the Oracle NoSQL Database Java SDK. D:\oracle-nosql-java-sdk-5.2.11
    Tenant ID and User ID Tenancy's OCID and User's OCID for your Oracle NoSQL Database Cloud Service. See Where to get the Tenancy's OCID and User's OCID in Oracle Cloud Infrastructure Documentation.
    Fingerprint and Passphrase(Optional) The fingerprint and passphrase of the signing key created while generating and uploading the API Signing Key.
    See the following resources in Oracle Cloud Infrastructure Documentation:
    Private Key The private key generated for the user. For the application user, an API signing key must be generated and uploaded. See How to Generate an API Signing Key to generate the signing key with an optional passphrase.
    Compartment (Optional) The compartment ID for your NoSQL database schema. If no value is specified, it defaults to the Root compartment.
  6. The Intellij plugin connects your project to the Oracle NoSQL Database Cloud Service and displays its schema in the Schema Explorer window.
  7. If required, you can change your service endpoint or compartment from the Schema Explorer window itself. To do this, click the More Options icon icon in the Schema Explorer window.
    A dialog window appears where you can provide the new values for Endpoint and Compartment. Enter the values that you want to modify, and click OK.
    You can provide values for:
    • Both Endpoint and Compartment, or
    • Endpoint alone. In this case, the Compartment defaults to the Root compartment in that region.
After you successfully connect your project to your Oracle NoSQL Database Cloud Service, you can manage the tables and data in your schema.

Connecting to Oracle NoSQL Database Cloud Simulator from IntelliJ

Learn how to connect your NoSQL project to Oracle NoSQL Database Cloud Simulator using the IntelliJ plugin.

Perform the following steps:
  1. Open your NoSQL project in IntelliJ.
  2. Click the Settings icon icon in the Schema Explorer window to open the Settings dialog for the plugin.
  3. Expand Tools > Oracle NoSQL in the Settings Explorer, and click Connections.
  4. Select Cloudsim from the drop-down menu for the connection type.
  5. Enter values for the following connection parameters, and click OK.

    Table 5-2 Connection Parameters

    Parameter Description Sample Value
    Service URL The IP address and port on which the Oracle NoSQL Database Cloud Simulator is running. The default value is http://localhost:8080
    Tenant Identifier Unique identifier to identify the tenant. The default value is exampleId. Retain this value if you want to test the examples.
    SDK Path Complete path to the directory where you extracted the Oracle NoSQL Database Java SDK. D:\oracle-nosql-java-sdk-5.2.11
  6. The Intellij plugin connects your project to the Oracle NoSQL Database Cloud Simulator and displays its schema in the Schema Explorer window.

    Note:

    Before connecting your project to Oracle NoSQL Database Cloud Simulator, it must be started and running. Otherwise, your connection request will fail in IntelliJ.
After you successfully connect your project to your Oracle NoSQL Database Cloud Simulator, you can manage the tables and data in your schema.

Managing Tables Using the IntelliJ Plugin

Learn how to create tables and view table data in Oracle NoSQL Database Cloud Service or Oracle NoSQL Database Cloud Simulator from IntelliJ.

After connecting to the Oracle NoSQL Database Cloud Simulator or Oracle NoSQL Database Cloud Service, you can execute the examples downloaded with Oracle NoSQL Database Java SDK to create a sample table. With the help of the IntelliJ Plugin, you can view the tables and their data in the Schema Explorer window.
To execute an example program:
  1. Open the NoSQL project connected to your Oracle NoSQL Database Cloud Service or simulator.
  2. Locate and click BasicTableExample in the Project Explorer window. By looking at the code, you can notice that this program creates a table called audienceData, puts two rows into this table, queries the inserted rows, deletes the inserted rows, and finally drops the audienceData table.
  3. To pass the required arguments, click Run > Edit Configurations. Depending on the connection type, enter the following program arguments, and click OK.

    Table 5-3 Program Arguments

    Connection Type Program Arguments More Information
    Cloudsim http://localhost:8080 If you started the Oracle NoSQL Database Cloud Simulator on a different port, you must replace 8080 with that port number.
    Cloud us-ashburn-1 -configFile D:\OCI_PROP\config The first argument indicates the data region of your Oracle NoSQL Database Cloud Service. The second argument passes a configuration file that contains the credentials to connect to the Oracle NoSQL Database Cloud Service.
  4. To execute this program, click Run > Run 'BasicExampleTable' or press Shift + 10.
  5. Verify the logs in the terminal to confirm that the code executed successfully. You can see the display messages that indicate table creation, rows insertion, and so on.

    Tip:

    As the BasicExampleTable deletes the inserted rows and drops the audienceData table, you can't view this table in the Schema Explorer. If you want to see the table in the Schema Explorer, comment the code that deletes the inserted rows and drops the table, and rerun the program.
  6. To view the tables and their data:
    1. Locate the Schema Explorer, and click the Refresh icon icon to reload the schema.
    2. Locate the audienceData table under your tenant identifier, and expand it to view its columns, primary key, and shard key details.
    3. Double-click the table name to view its data. Alternatively, you can right-click the table and select Browse Table.
    4. A record viewer window appears in the main editor. Click Execute to run the query and display table data.

      Note:

      As of the current release, only SELECT queries are supported on the NoSQL tables from the Schema Explorer.
    5. To view individual cell data separately, double-click the cell.