How to connect a SQL IDE to NetSuite with the SuiteAnalytics Connect JDBC driver

Check the role's SuiteAnalytics Connect permissions, download the JDBC driver, build the URL from your account's connection values and run Test Connection in DataGrip.

The quick answer

Open Set Up SuiteAnalytics Connect from the Settings portlet on Home, download the JDBC Driver and note the values in Your Configuration. In your SQL IDE, add NQjc.jar as a driver with the class com.netsuite.jdbc.openaccess.OpenAccessDriver, then create a data source that uses it. Enter your NetSuite email and password and a URL of the form jdbc:ns://<Service Host>:1708;ServerDataSource=NetSuite2.com;encrypted=1;NegotiateSSLClose=false;CustomProperties=(AccountID=<Account ID>;RoleID=<Role ID>;StaticSchema=1). Click Test Connection. It should read Succeeded.

Inline images show the field or area used in each step. Select Enlarge to see the complete recorded screen and its surrounding context.

The example is a supply company whose reporting analyst wants to run SQL against NetSuite from DataGrip, a JetBrains SQL IDE, instead of exporting saved searches. The screenshots use sample data, and the person and company names are fictional. The IDE screens are a generic stand-in for DataGrip built from its dark theme, so your IDE version may look a little different.

Before you start

SuiteAnalytics Connect is a separately provisioned service. Check with your NetSuite administrator that it is licensed, provisioned and enabled for your account. A role permission alone does not switch it on. If your account does not have it, the Set Up SuiteAnalytics Connect link is not there to find.

The role you sign in with needs the SuiteAnalytics Connect permission under Permissions > Setup, plus permissions for the records and transaction types you want to query. The example role also has SuiteAnalytics Connect - Read All, a broad read-access permission. It is not needed for every integration, so grant it only to a dedicated, restricted role that needs it, and use the lowest permission level your account allows. The role must be assigned to the user who signs in. The Role ID in the connection values is that of the role you opened the page with. To connect as another role, switch to it, reopen the page and copy the values it shows.

The IDE signs in with a NetSuite email and password. A role or user that requires interactive two-factor authentication generally cannot complete that sign-in. Use a dedicated integration user and role with a non-interactive method your security policy allows, such as token-based authentication, and test it in a sandbox first. Your IDE's Java runtime also has to trust the Connect service certificate. Most do already. If yours does not, follow the certificate instructions for your driver release: import the downloaded Certification Authority Certificates into the truststore of the Java runtime the IDE actually uses, or point the driver at a custom truststore. Never turn certificate validation off. Do not keep a production password in a shared IDE project, and store credentials in the IDE's protected password store.

01. Check the role's permissions

Go to Setup > Users/Roles > Manage Roles and open the SQL Reporting Analyst role, whose Role ID is 1062. Open Permissions, then the Setup subtab. SuiteAnalytics Connect and SuiteAnalytics Connect - Read All are both listed at Full for this role. The Set Up SuiteAnalytics Connect link is a portlet link, not a menu path. It is normally available only when the service is enabled and the role has this access, so a missing link means checking both, and the account's provisioning.

SuiteAnalytics Connect and SuiteAnalytics Connect - Read All are both Full on the Setup subtab.

02. Read the connection values

On Home, click Set Up SuiteAnalytics Connect in the Settings portlet.

Set Up SuiteAnalytics Connect sits in the Settings portlet on Home.

The page lists ODBC Driver 64-bit, ODBC Driver 32-bit, JDBC Driver and ADO.NET Driver, each with its release date, version and SHA256 checksum. Certification Authority Certificates are under Resources.

The Drivers list includes the JDBC Driver, version 8.10.147.0.

Select Your Configuration. It shows Service Host 6482915.connect.api.netsuite.com, Service Port 1708, Service Data Source NetSuite2.com, Account ID 6482915 and Role ID 1062. Copy them exactly instead of rebuilding the host by hand. The URL in step 5 is built from these.

Your Configuration holds the five values the JDBC URL needs.

03. Download the JDBC driver

Click Download beside JDBC Driver and save it. Check the file against the SHA256 checksum shown for it, install or unpack it, and keep NQjc.jar in a stable folder rather than a temporary downloads folder. The IDE needs that jar next. Driver versions, certificate requirements and supported Java versions change between releases, so use a driver your IDE's Java runtime supports and do not rely on the version numbers in the screenshots.

04. Register the driver in the IDE

In DataGrip, choose File > New > Driver. Menu wording varies a little between IDE versions. Enter the name NetSuite Connect JDBC. Under Driver Files, click +, choose Custom JARs, select NQjc.jar and click OK. Class fills in as com.netsuite.jdbc.openaccess.OpenAccessDriver. If it does not, choose that class from the list. Click OK to save the driver.

With NQjc.jar added, Class fills in as OpenAccessDriver.

05. Create the data source with the JDBC URL

The URL takes the host, AccountID and RoleID from Your Configuration. For production it is jdbc:ns://6482915.connect.api.netsuite.com:1708;ServerDataSource=NetSuite2.com;encrypted=1;NegotiateSSLClose=false;CustomProperties=(AccountID=6482915;RoleID=1062;StaticSchema=1). AccountID and RoleID are required and belong inside CustomProperties, and encrypted=1 turns on SSL. StaticSchema=1 is optional. It asks for a stable table list that makes the IDE's metadata browsing more predictable.

The note holds the production and sandbox URL patterns.

A sandbox has its own values, and they commonly use different separators in the two places: a hyphen in the host (6482915-SB1) and an underscore in AccountID (6482915_SB1). Do not swap them or work out the suffix from memory. Copy both from the Your Configuration panel of the sandbox account, and download the driver there.

Choose File > New > Data Source and pick NetSuite Connect JDBC. Name it NetSuite Production. Leave Authentication as User & Password. Enter your NetSuite email as User, enter your password and paste the URL into URL. Keep the credentials in these fields, never in the URL.

The data source uses the NetSuite Connect JDBC driver and the production URL.

06. Test the connection

Click Test Connection. The result reads Succeeded. Here it also lists the DBMS as OpenAccess (ver. 08.10), the driver as OpenAccess (ver. 8.1.00.0147, JDBC4.0) and a ping of 184 ms, and the Test Connection line shows a check mark. Those versions depend on the driver release and the IDE, so Succeeded is the result to look for. Click OK to save the data source. A small query against a table the role should be able to read, run afterwards, confirms table access. The walkthrough does not run one.

Succeeded means the driver, URL, user and role were all accepted.

Succeeded proves the driver loads, the host and port are reachable and the sign-in and role are accepted. It does not prove that a particular table is visible. Table access depends on the role's list, transaction and setup permissions, its subsidiary and other restrictions, and access to any custom records you query. If the connection works but a table is missing or empty, check those before you change the URL. If the test fails, recheck the Account ID, Role ID, host, user and password in that order, then the role's permissions, the driver jar and Java compatibility, the certificate and any firewall or proxy rules.

Common questions

How do I connect DataGrip to NetSuite?

Download the JDBC Driver from Set Up SuiteAnalytics Connect, add NQjc.jar as a driver in DataGrip with the class com.netsuite.jdbc.openaccess.OpenAccessDriver, create a data source with your NetSuite email and password and the JDBC URL, and click Test Connection. The account must have SuiteAnalytics Connect provisioned and enabled, and your role needs the SuiteAnalytics Connect permission.

Where do I download the NetSuite JDBC driver?

On the Set Up SuiteAnalytics Connect page. Click Set Up SuiteAnalytics Connect in the Settings portlet on Home, then click Download beside JDBC Driver. The same page lists the ODBC and ADO.NET drivers and the Certification Authority Certificates.

What does the NetSuite JDBC URL look like?

jdbc:ns://host:1708;ServerDataSource=NetSuite2.com;encrypted=1;NegotiateSSLClose=false;CustomProperties=(AccountID=your account ID;RoleID=your role ID;StaticSchema=1). Copy the host, port, Account ID and Role ID from Your Configuration instead of building them by hand. AccountID and RoleID are required, and StaticSchema=1 is optional.

What is the JDBC URL for a NetSuite sandbox?

Use the values from the sandbox account's own Your Configuration instead of editing a production URL. Sandbox values commonly put the suffix in the host with a hyphen and in AccountID with an underscore, for example 6482915-SB1 in the host and 6482915_SB1 in AccountID, but copy the exact values from that account.

What permissions does a role need for SuiteAnalytics Connect?

The SuiteAnalytics Connect permission under Permissions > Setup, plus permissions for the records and transaction types you want to query. SuiteAnalytics Connect - Read All is a broad read-access permission that is not needed for every integration, so give it only to a dedicated, restricted role that needs it. The service also has to be provisioned and enabled for the account.