Hitachi

Hitachi Advanced Database Application Development Guide


8.3.41 setQueryTimeout(int seconds)

Organization of this subsection

(1) Function

This method specifies the SQL processing timeout value.

(2) Format

public synchronized void setQueryTimeout(int seconds) throws SQLException

(3) Arguments

int seconds

Specifies an SQL processing timeout value (in seconds), in the range from 0 to 65,535.

If 0 is specified or this method is not executed, the value of adb_clt_rpc_sql_wait_time in the system properties, user properties, or URL connection properties takes effect.

If this method is executed, HADB monitors the following wait times:

  • How long the HADB client waits for the HADB server to respond to a processing request

    If this wait time is exceeded, a timeout error whose SQLCODE is -732 (KFAA30732-E) is returned to the application. When this occurs, processing of the SQL statement is canceled, and the transaction is rolled back. Then, the application is disconnected from the HADB server.

  • How long to wait to secure processing real threads if a shortage occurs when multiple SELECT statements are executed concurrently in the same connection

    If this wait time is exceeded, HADB returns a timeout error whose SQLCODE is -1071570 (KFAA71570-E) to the application. When this happens, processing of the SQL statement is canceled but the transaction is not rolled back. Nor is the application disconnected from the HADB server.

For details about the purpose of monitoring wait times using this method, see (4) Note about executing multiple SELECT statements concurrently in the same connection in 7.4.1 How to retrieve data.

(4) Return value

None.

(5) Exceptions

The JDBC driver throws an SQLException in the following cases:

(6) Notes

If 65,536 (maximum value of adb_clt_rpc_sql_wait_time property) or a greater value is specified for seconds, the specification of this method is ignored.