Contact Us
A netsuite consultant seated at a desk using a laptop, coffee cup in workspace.

If you've worked extensively with NetSuite saved searches, you may have encountered situations where writing a SQL query would be easier than configuring a saved search.

Maybe you need to investigate relationships between multiple record types, validate data, or test a query before incorporating it into a SuiteScript.

With SuiteAnalytics Connect and DBeaver, you can establish a local JDBC connection to NetSuite's analytics data source and run read-only SQL queries.

This guide walks through the setup process, from enabling SuiteAnalytics Connect to running your first query in DBeaver.

Why Use SQL to Query NetSuite Data?

NetSuite saved searches are useful for reporting and retrieving information without writing SQL. However, some tasks are easier to approach through a SQL interface.

For example, SQL can help you:

  • Explore relationships between NetSuite records.
  • Test joins across multiple supported record types.
  • Investigate data before writing SuiteScript N/query logic.
  • Export query results for analysis or validation.
  • Reuse queries across environments, with adjustments for differences in data and configuration.

SuiteAnalytics Connect provides access to the NetSuite2.com analytics data source, not unrestricted access to NetSuite's underlying application database.

The connection is read-only, and available data depends on the records exposed through the data source and the permissions assigned to your role.

What You'll Need

Before starting, make sure you have:

  • A NetSuite account with SuiteAnalytics Connect provisioned and enabled.
  • An appropriate NetSuite role with SuiteAnalytics Connect access and the required record permissions.
  • Access to download the SuiteAnalytics Connect JDBC driver.
  • A local installation of DBeaver.
  • An authentication method supported by your NetSuite account and security configuration.

SuiteAnalytics Connect is a separately provisioned feature. If it isn't available in your account, contact your NetSuite account representative.

Step 1: Download and Install DBeaver

Start by downloading https://dbeaver.io/.

DBeaver is a database management application that supports JDBC connections and provides a SQL editor for writing and running queries.

Install the application for your operating system.

Once installed, you'll configure it to use NetSuite's JDBC driver.

Step 2: Enable SuiteAnalytics Connect

Before connecting DBeaver, confirm that SuiteAnalytics Connect is enabled in your NetSuite account.

In NetSuite, navigate to:

Setup > Company > Enable Features

Open the Analytics subtab and locate SuiteAnalytics Connect.

If the feature is available but not enabled, an authorized administrator can enable it.

If the feature isn't listed, it may not be provisioned for your account.

Oracle provides additional instructions in its SuiteAnalytics Connect feature documentation.

Step 3: Configure a Role for SuiteAnalytics Connect

Next, configure a NetSuite role that has the permissions required to access the analytics data source.

The role determines which data the connection can access.

At a minimum, review the appropriate SuiteAnalytics Connect permission and the permissions for the record types you need to query.

For example, querying customer and transaction data may require different permissions than querying item records.

Assign the role to the authorized user who will establish the connection.

Security note: Follow your organization's access-control and authentication requirements. Avoid disabling two-factor authentication or broadly increasing role permissions solely to make a database connection work.

Once the role has been configured, record its internal ID. You'll need that value when creating the JDBC connection.

image (13).webp

Step 4: Download the SuiteAnalytics Connect JDBC Driver

The JDBC driver allows DBeaver to communicate with SuiteAnalytics Connect.

In NetSuite, locate the Set Up SuiteAnalytics Connect link in the Settings portlet.

Open the driver download page and select the appropriate JDBC driver for your operating system.

The page also displays connection details, including:

  • Service Host
  • Service Port
  • Service Data Source
  • Account ID
  • Role ID

You'll use these values when configuring DBeaver.

large_image_e9f6cbe395.png
You’ll want to note these, cause you’ll need them shortly…

Download and install or extract the driver according to Oracle's instructions.

Locate the NQjc.jar file included with the driver. Keep it in a location where it won't be accidentally moved or deleted.

Step 5: Configure the JDBC Driver in DBeaver

Open DBeaver.

Navigate to:

Database > Driver Manager

Create a new driver configuration.

image (14).webp
image (15).webp

Under the Libraries tab, choose Add File and select the NQjc.jar file downloaded from NetSuite.

image (16).webp

Next, select Find Class to identify the driver class.

Oracle documents the following class for the SuiteAnalytics Connect JDBC driver:

com.netsuite.jdbc.openaccess.OpenAccessDriver

image (17).webp

Give the driver a recognizable name, such as NetSuite SuiteAnalytics Connect.

small_image_18_3dc952d047.png

Save the driver configuration.

If you're working with multiple NetSuite accounts, use descriptive connection names to distinguish them. Follow Oracle's driver compatibility guidance when deciding whether different environments require different driver configurations.

Step 6: Create the NetSuite Database Connection

In DBeaver, create a new database connection using the driver you just configured.

image (19).webp

 

image (20).webp

In the JDBC URL field, enter a connection string using the values from your SuiteAnalytics Connect configuration.

Oracle documents the following connection URL format:

jdbc:ns://<ServiceHost>:1708;ServerDataSource=NetSuite2.com;Encrypted=1;NegotiateSSLClose=false;CustomProperties=(AccountID=<AccountID>;RoleID=<RoleID>);

Replace the placeholders with your environment's values:

  • ServiceHost: The host provided on the SuiteAnalytics Connect driver download page.
  • AccountID: Your NetSuite account ID.
  • RoleID: The internal ID of the role configured for the connection.

Use the service host supplied by NetSuite rather than assuming that the hostname follows a particular pattern.

image.png

Configure Authentication

Supply the authentication details required by your NetSuite environment.

Oracle's JDBC documentation includes username-and-password connection properties. However, your organization's security configuration may determine which authentication approaches are permitted.

Do not include passwords or authentication tokens directly in screenshots, shared SQL files, or published connection strings.

For the connection properties and supported configuration details, refer to Oracle's JDBC connection documentation.

Test the Connection

Select Test Connection in DBeaver.

If the connection succeeds, save it.

image.png

You should now see the NetSuite connection in DBeaver's database navigator.

If the connection fails, review the driver configuration, service host, account ID, role ID, authentication details, and required permissions.

Step 7: Run SQL Queries Against NetSuite2.com

Once the connection is established, open a SQL editor in DBeaver.

You can now write and execute SQL queries against the records available through SuiteAnalytics Connect.

For example, a basic query might retrieve a limited number of customer records:

SELECT
    id,
    entityid
FROM
    customer
FETCH FIRST 10 ROWS ONLY

This example assumes that the customer record type and selected fields are available to your role.

The exact records and fields you can query depend on the NetSuite2.com data source and your account permissions.

You can also use DBeaver to inspect available data, develop more complex queries, and export query results.

Remember that SuiteAnalytics Connect is read-only. SQL queries through this connection cannot directly insert, update, or delete NetSuite records.

Tips for Working with NetSuite SQL Queries

A few practices can make the experience more useful:

Start with small queries. Limit the number of returned records while developing or troubleshooting a query.

Check record and field availability. Not every NetSuite field is exposed through SuiteAnalytics Connect, and permissions affect what you can retrieve.

Validate joins carefully. Make sure the relationships between records produce the expected results, particularly when joining transaction-related data.

Protect exported information. Read-only access doesn't mean the information is non-sensitive. Apply your organization's data-handling requirements to query results and exports.

Test before reusing SQL in SuiteScript. A query that works through SuiteAnalytics Connect may need adjustments before it can be used with the SuiteScript N/query module.

Final Thoughts

DBeaver and SuiteAnalytics Connect provide a useful way to explore NetSuite data using SQL.

For developers, consultants, and administrators who regularly work with saved searches, SuiteScript queries, or data validation, a local SQL editor can make certain investigations more convenient.

The important distinction is that you're accessing a supported, read-only analytics data source rather than connecting directly to NetSuite's underlying application database.

With the appropriate permissions, JDBC driver, and connection settings, you can use DBeaver to investigate records and develop queries without relying exclusively on the NetSuite interface.

Related Articles

Tagged with Training