This topic describes how to configure the MaxCompute JDBC driver on SQL Workbench/J.
After the configuration, you can connect SQL Workbench/J to a MaxCompute project to
execute SQL statements.
Prerequisites
- SQL Workbench/J is installed. SQL Workbench/J Build 125 (2019-05-08) is used in this topic.
- The MaxCompute JDBC driver is downloaded. The MaxCompute JDBC driver V3.0.1 is used in this topic.
- Java 8 or later is installed.
Background information
SQL Workbench/J is a JDBC client tool. The procedure set out in this topic also can
be used to configure the MaxCompute JDBC driver on other tools.
Note If you encounter any issues when you configure the MaxCompute JDBC driver on other
tools, submit
issues.
Procedure
- Start SQL Workbench/J and click Manage Drivers.
- On the page that appears, click the icon.
- Set Name to MaxCompute.
- Click the icon to upload the MaxCompute JDBC driver that you have downloaded. The Classname parameter is automatically set to com.aliyun.odps.jdbc.OdpsDriver.
- Click OK to return to the profile configuration page.
- Set URL, Username, and Password.
- URL: the URL for connecting to the specified MaxCompute project. The value must be in
the jdbc:odps:<maxcompute_endpoint>?project=<maxcompute_project_name> format, where:
- <maxcompute_endpoint>: the endpoint of MaxCompute in a specific region. For example, the public endpoint
of MaxCompute in the China (Hangzhou) region is
http://service.cn-hangzhou.maxcompute.aliyun.com/api
. For more information about MaxCompute endpoints, see Endpoints.
- <maxcompute_project_name>: the name of the MaxCompute project.
The following URL shows an example:
jdbc:odps:http://service.cn-hangzhou.maxcompute.aliyun.com/api?project=test_project
- Username: the AccessKey ID of the account that has access to the specified MaxCompute project.
- Password: the AccessKey secret of the account that has access to the specified MaxCompute
project.
- Click OK. On the SQL execution page that appears, you can execute MaxCompute SQL statements.