Configuring DBeaver to Connect to DLI for Data Query and Analysis
DBeaver is a free, open source, and visual database management tool that you can use to manage various types of databases, including viewing the database structure, executing SQL queries and scripts, and browsing and exporting data. This section describes how to configure DBeaver to connect to DLI.
Preparations
- Toolkits
- DLI JDBC driver:
Download the JDBC driver huaweicloud-dli-jdbc-xxx-dependencies.jar from the DLI management console.
- DBeaver client installation package:
The DBeaver official website provides client installation packages for different OSs. Download the required DBeaver client installation package and install it on the local PC. DBeaver 24.0.3 is recommended.
- DLI JDBC driver:
- Connection information:
Table 1 Connection information Item
Description
How to Obtain
DLI's AK/SK
AK/SK-based authentication refers to the use of an AK/SK pair to sign requests for identity authentication.
DLI's endpoint address
Endpoint of a cloud service in a region.
DLI's project ID
Project ID, which is used for resource isolation.
DLI's region information
DLI's region information
Step 1: Create a DLI JDBC Driver on DBeaver
- In DBeaver, choose Database > Driver Manager.
Use the driver class to load DLI's JDBC driver. Make sure to use the JAR file huaweicloud-dli-jdbc-2.1.1-jar-with-dependencies.jar.
- Click New.
- In the displayed dialog box, set driver parameters and click OK.
Set driver parameters based on Table 2.
Table 2 Driver parameters Parameter
Description
Driver Name
Enter a name that is easy to identify, for example, GaussDB Driver.
Driver Type
Set it to Generic.
Class Name
Java class name used to establish a database connection in the JDBC driver.
URL Template
Format of DLI's JDBC driver.
For how to configure DLI's JDBC driver, see Format of DLI's JDBC driver and Example configuration of DLI's JDBC driver.
jdbc:dli://<endPoint>/projectId?<key1>=<val1>;<key2>=<val2>...
Default Port
Port of the database to connect.
Default Database
Name of the database to connect.
Default User
Account name, which is root by default.
- Format of DLI's JDBC driver
jdbc:dli://<endPoint>/projectId?<key1>=<val1>;<key2>=<val2>...
? is followed by other configuration items, with each item listed in the "key=value" format and multiple items are separated by semicolons (;).
- Example configuration of DLI's JDBC driver
jdbc:dli://dli.ap-southeast-2.myhuaweicloud.com/0b33ea2a7e0010802fe4c009bb05076d?databasename=tpch;queuename=auto;accesskey=XXXX;secretkey=XXXXX;regionname=ap-southeast-2;enginetype=trino;catalog=lfcatalog
Table 3 and Table 4 describe the parameters.
Table 3 Driver configuration parameters Parameter
Description
How to Obtain
endPoint
Endpoint of a cloud service in a region.
projectId
ID of the project where DLI resources are.
<key1>=<val1>
? is followed by other configuration items, with each item listed in the "key=value" format and multiple items are separated by semicolons (;).
- Format of DLI's JDBC driver
- On the Libraries tab, click Add File and add dli-jdbc-xxx-dependencies.jar in 1.
- After the file is added, the driver class is empty. Click Find Class to set the driver class. The identified driver class must be the same as the class name specified on the Settings tab.
- Click OK to complete the driver settings.
Step 2: Test the Connection to the Database
- In the menu bar of the DBeaver client, choose Database > New Database Connection and select the data driver created in Step 1: Create a DLI JDBC Driver on DBeaver.
- Click Finish to connect to DLI. You can view information about the connected database in the Database Navigator view toolbar.
- Query data on DLI through the new connection.
Step 3: Compile SQL Queries on DBeaver
Once DBeaver is connected to DLI, you can compile SQL queries on DBeaver.
- Select a database object in Database Navigator on the left and write SQL statements in the SQL editor in the middle.
- Once a query is compiled, execute it by clicking the running button on the toolbar, which is usually represented by a green play icon.
- After the query is executed, the result is displayed in the data grid below the SQL editor.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot