--- title: "JDBC" slug: "dataquery-jdbc-vpc" updated: 2026-09-17T09:18:10Z published: 2026-09-17T09:18:10Z canonical: "guide.ncloud-docs.com/dataquery-jdbc-vpc" --- > ## Documentation Index > Fetch the complete documentation index at: https://guide.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # JDBC Available in VPC It describes how to use the JDBC provided by Data Query. Note NAVER Cloud Platform's Data Query JDBC currently does not support authentication methods other than User&Password. - Authenticate a user by entering User AccessKey for the user and User SecretKey for the password. ## Preparations Java 8 or later must be installed in the environment where you will be using JDBC. ## How to use It describes how to use Data Query JDBC. ### 1. Download Download the JDBC executable file for Data Query from the following link: [dataquery-jdbc-101-437.zip](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/dataquery-jdbc-101-437.zip?sv=2026-02-06&spr=https&st=2026-11-14T04%3A50%3A28Z&se=2026-11-14T05%3A50%3A28Z&sr=c&sp=r&sig=zcoVhlhAVvuX6FjrN7p499uRYrrCvBlsY9bLwZ6Hd5A%3D) Note Data Query JDBC is based on [trinodb/trino](https://github.com/trinodb/trino), an open source. For more information on relevant licenses, see the NOTICE file. ### 2.1. Integrations using DB Tool You can register the Data Query JDBC Driver with DB Tool to issue queries to Data Query. This guide will walk you through connecting to Data Query via JetBrains DataGrip. Note This guide is based on version `DataGrip 2023.1.1`. #### 2.1.1. Register Data Query JDBC Driver To register the Data Query JDBC driver, follow these steps: ![dataquery-jdbc-vpc-01](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/dataquery-jdbc-vpc-01.png?sv=2026-02-06&spr=https&st=2026-11-14T04%3A50%3A28Z&se=2026-11-14T05%3A50%3A28Z&sr=c&sp=r&sig=zcoVhlhAVvuX6FjrN7p499uRYrrCvBlsY9bLwZ6Hd5A%3D) 1. In DataGrip, click **File > New > Driver** in order. 2. Click the **Drivers** tab, then click the **[+]** button. 3. In the Name field, enter `NCP Data Query`. 4. Click the **[+]** button in the Driver Files area. 5. Select **Custom Jars**, and then click to select the downloaded driver file in the search window. 6. Select **io.trino.jdbc.TrinoDriver** from the list of Class entries. 7. To complete the registration, click the **[Apply]** button or the **[OK]** button. #### 2.1.2. Register Data Query Data Source To register Data Query Data Source, follow these steps: ![dataquery-jdbc-vpc-02](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/dataquery-jdbc-vpc-02.png?sv=2026-02-06&spr=https&st=2026-11-14T04%3A50%3A28Z&se=2026-11-14T05%3A50%3A28Z&sr=c&sp=r&sig=zcoVhlhAVvuX6FjrN7p499uRYrrCvBlsY9bLwZ6Hd5A%3D) 1. In DataGrip, click **File > New > Data Source > NCP Data Query** in order. 2. In the User field, enter the **user AccessKey information**. 3. In the Password field, enter the **user SecretKey information**. 4. In the URL field, enter the **Data Query JDBC URL information**. - For more information, see Data Query Service JDBC URLs by Region. 5. Click the **[Test Connection]** button to verify that you have successfully connected. 6. To complete the registration, click the **[Apply]** button or the **[OK]** button. #### 2.1.3. Available options Detailed connection settings can be set in the **[Advanced]** tab of the registered Data Source. | Option name | Data type | Input values | Required | Note | | --- | --- | --- | --- | --- | | reuseQueryResult | Boolean | `true` or `false` | N | * default : `false` | | reuseQueryMaxAge | Integer | `1` ~ `10,080` | N | * default : `60` * Use only when reuseQueryResult value is `true` (Unit: minute) | Example: connect JDBC to reuse the same request query within the last 1 hour as the query result to submit. ![dataquery-jdbc-vpc-03](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/dataquery-jdbc-vpc-03.png?sv=2026-02-06&spr=https&st=2026-11-14T04%3A50%3A28Z&se=2026-11-14T05%3A50%3A28Z&sr=c&sp=r&sig=zcoVhlhAVvuX6FjrN7p499uRYrrCvBlsY9bLwZ6Hd5A%3D) **Data Query Service JDBC URLs by Region** Currently, only the KR Region is available, with more Regions to be provided later. | Region | JDBC URL | | --- | --- | | KR | jdbc:trino://kr.dataquery.naverncp.com:443 | Note It is provided based on dataquery-jdbc trino-jdbc. For more information beyond the options above, see [Trino documentation](https://trino.io/docs/437/client/jdbc.html). #### 2.1.4. Submit queries and view results Depending on how you use the tool, connect to the added Data Source to submit a query and view the results. Example: ![dataquery-jdbc-vpc-03](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/dataquery-jdbc-vpc-04.png?sv=2026-02-06&spr=https&st=2026-11-14T04%3A50%3A28Z&se=2026-11-14T05%3A50%3A28Z&sr=c&sp=r&sig=zcoVhlhAVvuX6FjrN7p499uRYrrCvBlsY9bLwZ6Hd5A%3D) ### 2.2. Integrate with JDBC in Java projects You can add the Data Query JDBC Driver as a Library in your Java Project to issue queries to Data Query. This guide describes how to connect to Data Query through JetBrains IntelliJ IDEA. Note - This guide is based on version `IntelliJ IDEA 2023.1`. - In case you use build automation tools, such as [Gradle](https://gradle.org/) or [Maven](https://maven.apache.org/), see [DataQuery Repository documentation](https://github.com/NaverCloudPlatform/DataQuery-Repository/blob/main/README.md) It enables easier JDBC integrations. #### 2.2.1. Register Data Query JDBC Driver library Add the downloaded JDBC Driver to the project settings to register the Data Query JDBC driver library. To register the Data Query JDBC Driver library, follow these steps: ![dataquery-jdbc-vpc-03](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/dataquery-jdbc-vpc-05.png?sv=2026-02-06&spr=https&st=2026-11-14T04%3A50%3A28Z&se=2026-11-14T05%3A50%3A28Z&sr=c&sp=r&sig=zcoVhlhAVvuX6FjrN7p499uRYrrCvBlsY9bLwZ6Hd5A%3D) 1. Click **IntelliJ > Project Settings > Modules** in order. 2. Click the **[Dependencies]** tab, then click the **[+]** button. 3. Select **JARs or Directories**, and click to select the downloaded driver file in the search window. 4. To complete the registration, click the **[Apply]** button or the **[OK]** button. #### 2.2.2. Submit queries and view results Write the code to submit the query and view the results. Example: ``` package org.example; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.util.Properties; public class DataQueryJdbcDemo { public static void main(String[] args) { final String accesskey = "{my-access-key}"; final String secretKey = "{my-secret-key}"; final String jdbcUrl = "{dataquery-jdbc-url}"; String query = """ SELECT movieId, COUNT(*) AS ratingCount FROM public_data.the_movies_dataset.ratings_small GROUP BY movieId ORDER BY ratingCount DESC LIMIT 10 """; try { // Create a connection /* You can select between using properties and using url parameters. */ // 1. properties Properties properties = new Properties(); properties.setProperty("user", accesskey); properties.setProperty("password", secretKey); properties.setProperty("SSL", "true"); Connection connection = DriverManager.getConnection(jdbcUrl, properties); // 2. URL parameters // String url = String.format("%s?user=%s&password=%s&SSL=true", jdbcUrl, accesskey, secretKey); // Connection connection = DriverManager.getConnection(url); // Create a statement Statement stmt = connection.createStatement(); // Execute the SELECT query ResultSet resultSet = stmt.executeQuery(query); // Process the query results long index = 0L; while (resultSet.next()) { System.out.println( String.format("[%d] %s %d", index, resultSet.getString(1), resultSet.getInt(2)) ); index++; } // Close the result set resultSet.close(); } catch (Exception e) { e.printStackTrace(); } } } ``` ``` // Result examples [0] 356 341 [1] 296 324 [2] 318 311 [3] 593 304 [4] 260 291 [5] 480 274 [6] 2571 259 [7] 1 247 [8] 527 244 [9] 589 237 ``` #### 2.2.3. Available options You can use the same as described in [2.1.3. Available options](/docs/en/dataquery-jdbc-vpc#213%EC%82%AC%EC%9A%A9%EA%B0%80%EB%8A%A5%ED%95%9C%EC%98%B5%EC%85%98). Depending on your connection method, use it in the following form: - Properties method: add to Properties in the form of `properties.setProperty("옵션명", 옵션값)`. - Url method: add to Url strings in the form of `"{dataquery-jdbc-url}?옵션명=옵션값"`.