8.3.35 setHADBOrderMode(int mode)
- Organization of this subsection
(1) Function
Sets the sorting order of character string data in ORDER BY clauses that are enabled for the connection to the HADB server using this Connection object. The following ORDER BY clauses are applicable:
-
ORDER BY clauses specified in the outermost query expression of the SELECT statement
-
ORDER BY clauses specified in the outermost query expression body of the COPY statement
The information set in this method corresponds to the adb_clt_sql_order_mode operand in the client definition.
(2) Format
public void setHADBOrderMode(int mode) throws SQLException
(3) Arguments
- int mode
-
Specifies the sort order for character string data when the following ORDER BY clause is specified.
-
The ORDER BY clause specified in the outermost query expression of the SELECT statement.
-
The ORDER BY clause specified in the outermost query expression body of the COPY statement.
Specify one of the following values:
-
AdbConnection.HADB_SQL_ORDER_MODE_BYTE
Sort character string data by bytecode.
-
AdbConnection.HADB_SQL_ORDER_MODE_ISO
Sort character string data by sort code (ISO/IEC 14651:2011 compliance).
-
(4) Return value
None.
(5) Exceptions
The JDBC driver throws an SQLException in the following cases:
-
The Connection object is closed.
-
A transaction has already started.
-
The specified sort order is not one of the following:
• AdbConnection.HADB_SQL_ORDER_MODE_BYTE
• AdbConnection.HADB_SQL_ORDER_MODE_ISO
(6) Notes
-
The sort order for character string data in an ORDER BY clause specified in the outermost query expression of a SELECT statement is determined according to the priority shown below. Similarly, the sort order for character string data in an ORDER BY clause specified in the outermost query expression body of a COPY statement is determined according to the priority shown below. The smaller the number, the higher the priority. For example, if 1 and 2 are both specified, 1 takes effect.
-
Sort order specified with the setHADBOrderMode method
-
Sort order specified with the adb_clt_sql_order_mode system property
-
Value of the adb_clt_sql_order_mode property specified in the info argument of the getConnection method of the DriverManager class
-
Value of adb_clt_sql_order_mode property specified in the url argument of the getConnection method of the DriverManager class
-
Sort order specified with the adb_sql_order_mode server definition operand
-
-
When a Connection object is pooled and then reused, the sort order of the character string data in the ORDER BY clause specified in the outermost query expression of the SELECT statement, as specified by the setHADBOrderMode method, is not inherited from the previous sort order. In such a case, the sort order remains the same as it was before the setHADBOrderMode method was executed. Similarly, the sort order for character string data in an ORDER BY clause specified in the outermost query expression body of a COPY statement, as specified by the setHADBOrderMode method, follows the same principle.
-
This is an HADB-specific method provided by the AdbConnection interface. For details about the execution method, see 12.2 Wrapper interface.