MaxCompute allows you to use the database management tool SQL Workbench/J to access MaxCompute projects and manage data. This topic describes how to use a MaxCompute Java Database Connectivity (JDBC) driver to connect SQL Workbench/J to MaxCompute projects and use SQL Workbench/J to manage data.
Background information
SQL Workbench/J is a free, DBMS-independent, and cross-platform SQL query tool. SQL Workbench/J is written in Java and can run on operating systems that provide the Java Runtime Environment (JRE). For more information about SQL Workbench/J, see SQL Workbench/J.
Prerequisites
- A MaxCompute project is created.
For more information, see Create a MaxCompute project.
- The AccessKey pair of your Alibaba Cloud account that is used to access the MaxCompute
project is obtained.
You can click the profile picture in the upper-right corner of the MaxCompute console and select AccessKey Management to obtain the AccessKey pair.
- The JAR package of MaxCompute JDBC driver V3.0.1 or later is downloaded. This package includes the
jar-with-dependencies
package.MaxCompute JDBC driver V3.2.9 is used in this topic.
- SQL Workbench/J is downloaded and installed.
For more information about how to install SQL Workbench/J, see Installing and starting SQL Workbench/J.
SQL Workbench/J Build 127 (2020-08-22) is used in this topic.
- Java 8 or later is installed.
Procedure
To connect SQL Workbench/J to the MaxCompute project and use SQL Workbench/J to manage the MaxCompute project, perform the following steps:
Step 1: Add the MaxCompute JDBC driver
Step 2: Connect SQL Workbench/J to MaxCompute
Step 3: Use SQL Workbench/J to manage the MaxCompute project
- Query all existing tables
After you establish the connection between SQL Workbench/J and the MaxCompute project, you are redirected to the SQL execution page. Then, you can execute the
show tables;
statement to query information of all existing tables. - Query table schema
After you establish the connection between SQL Workbench/J and the MaxCompute project, you are redirected to the SQL execution page. Then, you can execute the
desc <table_name>;
statement to query the schema of a table. - Query table data
After you establish the connection between SQL Workbench/J and the MaxCompute project, you are redirected to the SQL execution page. Then, you can execute the SELECT statement to query the data of a table.