X

The Oracle NoSQL Database Blog covers all things Oracle NoSQL Database. On-Prem, Cloud and more.

  • May 10, 2021

Simplify modern application development with NoSQL database using popular IntelliJ IDE plugin

Vandanadevi Rajamani
Principal User Assistance Developer

Oracle NoSQL Database is designed for today’s most demanding applications that require low latency responses, flexible data models, and elastic scaling for dynamic workloads.

Oracle NoSQL Database is a solution for applications with the following characteristics:

  • Produce and consume data at high volume and velocity
  • Require instantaneous response times to match user expectations
  • Developed with continuously evolving data models
  • Scale on-demand based on the dynamic workloads

Are you a NoSQL developer using Java, Python, Node.js, or Go APIs?. Do you need help quickly connecting to the NoSQL Database? Would you be excited to know that you could do this in under five minutes? Read on.

IDEs like IntelliJ makes application development an enjoyable, hassle-free experience. The IntelliJ plugin helps in coding assistance, provides built-in tools and plugins to support additional functionality. Every time you test your application code in a typical setup as a developer, you must access the NoSQL Database objects. Here, you could use tools such as SQL Developer to verify the updates. However, if you can browse the NoSQL Database right from IntelliJ and view the updates as you execute your code side by side, you will save a lot of time and effort. The IntelliJ plugin precisely lets you do that to view the NoSQL Database alongside your java code within IntelliJ!

The IntelliJ plugin connects to a running instance of Oracle NoSQL Database and allows you to:

  • Quickly get started with Oracle NoSQL Database by using the examples available with the plugin.
  • View the tables in your database.
  • 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.

Simple steps to connect to the Oracle NoSQL Database from the IntelliJ plugin:

Download and Install IntelliJ plugin:

1. Download and Install IntelliJ plugin:

Download the IntelliJ plugin from Oracle Technology Network, and install the plugin from disk. You can connect to an Oracle NoSQL Database Cloud Service or an on-premise Oracle NoSQL database from the IntelliJ plugin.

2. Connect to your Oracle NoSQL Database

  • Connecting to Oracle NoSQL Database Cloud service

           If you are developing an application that connects to Oracle NoSQL Database Cloud Service (NDCS), watch this video to understand the simple steps to connect to an Oracle NoSQL Database Cloud Service from IntelliJ Plugin.

          https://youtu.be/u1VUCqNiBsU

  • Connecting to an on-premise Oracle NoSQL Database

    If you have configured a non-secure Oracle NoSQL database, watch this video to understand the simple steps to connect to your database from IntelliJ Plugin.

    https://youtu.be/J8qo-bAfHBo

    If your Oracle NoSQL database is a secure store, you will need to supply additional information like Trust store information and user credentials while connecting it from the IntelliJ plugin. Watch this video to understand the simple steps to connect to your secure Oracle NoSQL Database from IntelliJ Plugin.

    https://youtu.be/Qrn339g1p9

3. Access your NoSQL Database from IntelliJ

Once connected to the Oracle NoSQL database, you can do the following in your application.

Create a table add data to it:

final String createTableStatement =
  "CREATE TABLE IF NOT EXISTS " + tableName +
  "(cookie_id LONG, " +
  " audience_data JSON, " +
  " PRIMARY KEY(cookie_id))";
  TableRequest tableRequest = new TableRequest()
            .setStatement(createTableStatement)
            .setTableLimits(new TableLimits(50, 50, 50));
  TableResult tres = handle.tableRequest(tableRequest);

 

MapValue value = new MapValue()
            .put("cookie_id", 123) // fill in cookie_id
            .put("audience_data", // fill in audience_data
            "{\"ipaddr\" : \"10.0.00.xxx\"," +
            " \"audience_segment\": { " +
            " \"sports_lover\" : \"2018-11-30\"," +
            " \"book_reader\" : \"2018-12-01\"" +
            " }" +
            " }");
PutRequest putRequest = new PutRequest()
            .setValue(value)
            .setTableName(tableName);
PutResult putRes = handle.put(putRequest);

 

View data on the table

String query = "SELECT * from " + tableName + "
    WHERE cookie_id = 456";
List results = Common.runQuery(handle, query);
System.out.println("Number of query results for " +query +
     ": " + results.size());
for (MapValue qval : results) {
    System.out.println("\t" + qval.toString());
}

 

Drop the table from the database

tableRequest = new TableRequest()
      .setStatement("DROP TABLE IF EXISTS " + tableName);
tres = handle.tableRequest(tableRequest);

 

You can view the results from your IntelliJ plugin, as you execute your code side by side, thus saving a lot of your time and effort.

 

Thus you can accelerate your application development using this IntelliJ IDE plugin.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.