All Products
Search
Document Center

MaxCompute:FAQ about JDBC

Last Updated:Jun 27, 2025

This topic provides answers to some frequently asked questions about Java Database Connectivity (JDBC).

Category

FAQ

Usage of the MaxCompute JDBC driver

Can I disable the auto-commit mode for the MaxCompute JDBC driver?

MaxCompute does not support transactions. Each query is immediately performed on the server. The auto-commit mode is automatically enabled for the MaxCompute JDBC driver. Therefore, you cannot disable the auto-commit mode for the MaxCompute JDBC driver.

Does the MaxCompute JDBC driver require a connection pool?

MaxCompute provides the Representational State Transfer (REST) service, which is different from the way that traditional databases maintain long connections. The connection creation by using the MaxCompute JDBC driver is a lightweight operation. Therefore, the MaxCompute JDBC driver does not require a connection pool. However, the MaxCompute JDBC driver supports connection pools.

How do I view the logs of the MaxCompute JDBC driver?

The MaxCompute JDBC driver provides a dual-mode logging system to meet different scenario requirements:

SLF4J integrated logging

When your application system already uses the SLF4J logging framework, the driver automatically inherits the logging configuration of the main application without additional operations. The log content follows the global logging configuration policy of the application, such as the log path and level.

Independent logging system (ODPS Logger)

You can enable the independent logging system through JDBC URL parameters:

jdbc:odps:<endpoint>?enableOdpsLogger=true

Note:

  • Log file path: in the same directory as the JDBC driver JAR file (or in the same directory as the fat JAR file if packaged as a fat JAR file)

  • Log file name: jdbc.log

How do I obtain a MaxCompute LogView URL?

LogView is a visualization monitoring tool for MaxCompute tasks. Through the LogView URL, you can view task execution status, resource consumption, data forwarding, and other key diagnostic information in real time. You can obtain the LogView URL in the following ways based on different integration methods:

Code integration

You can obtain the LogView URL directly through the JDBC API:

// Create a statement object.
Statement statement = connection.createStatement();

// Execute a query (including DDL/DML statements).
statement.executeQuery("SELECT * FROM table_name");

// Obtain the LogView URL (type conversion required).
String logviewUrl = ((OdpsStatement) statement).getLogViewUrl();
System.out.println("Logview URL: " + logviewUrl);
Note: getLogViewUrl() can be called only after the SQL statement is successfully submitted, but you do not need to wait for the task to complete.

JAR package integration

When you call the JDBC JAR package directly through the command line or script:

  1. Make sure that log output is enabled.

  2. Search for the keyword LogView in the log file. The LogView link is valid for 7 days.

What do I do if the number of rows of data that is read by using the MaxCompute JDBC driver exceeds 10,000?

Data reading and downloading through JDBC connections are implemented through Tunnel by default. For data security considerations, there is a 10,000-row download limit. You can remove this limit by using the enableLimit parameter.

jdbc:odps:<endpoint>?enableLimit=false

When this parameter is set to false, the server performs download authentication on all tables involved in the query. If download permissions are not granted, an exception is thrown. For more information about how to grant the download permissions, see Download control.

What do I do if the error message "ODPS-0410042:Invalid signature value" appears when I access MaxCompute by using the JDBC driver?

Make sure that the AccessKey ID and AccessKey secret you enter are the same as the AccessKey ID and AccessKey secret of your authorized account.

What do I do if the error message "create download session failed: instance id=xxx, Error:ErrorCode=Local Error, ErrorMessage=Failed to create download session with tunnel endpoint" appears when I access MaxCompute by using the JDBC driver?

An error occurs when the JDBC driver connects to MaxCompute to obtain SQL results by using Tunnel commands. For more information about how to troubleshoot the error, see Error message: ErrorCode=Local Error, Failed to create download session with tunnel endpoint.