8.2.33 setHADBAuditInfo(int pos,String userinfo)
- Organization of this subsection
(1) Function
This method sets user-added information, such as the account information of applications that access the HADB server. The user-added information that is set has effect until it is revoked.
The user-added information set by using this function is output as an audit trail at the following times:
-
When an SQL statement that includes a Statement object generated by using the Connection object is executed
-
When an SQL statement that includes a PreparedStatement object generated by using the Connection object is executed
-
When the Connection object is closed
(2) Format
public synchronized void setHADBAuditInfo(int pos,String userinfo) throws SQLException
(3) Arguments
- int pos
-
Specifies which column in the audit trail the user-added information specified by userinfo is to be output to. Specify one of the following values:
1: Specify this value to output the user-added information specified by userinfo to user-added information 1 in the audit trail.
2: Specify this value to output the user-added information specified by userinfo to user-added information 2 in the audit trail.
3: Specify this value to output the user-added information specified by userinfo to user-added information 3 in the audit trail.
- String userinfo
-
Specifies user-added information.
The user-added information specified here is converted in the character encoding that is used on the HADB server. Make sure that the size of the specified user-added information does not exceed 100 bytes after the character encoding is converted.
Note that a null character (0x00) cannot be used.
To revoke the specification of the user-added information, specify null.
(4) Return value
None.
(5) Exceptions
The JDBC driver throws an SQLException in the following cases:
-
The Connection object is closed.
-
The value specified in pos is not a value in the range from 1 to 3.
-
Character encoding conversion of the user-added information fails.
-
The size of the user-added information exceeds 100 bytes after the character encoding is converted.
-
The user-added information includes a null character (0x00).
-
A transaction has already started.
(6) Notes
-
This is an HADB-specific method provided by the AdbConnection interface. For details about the execution method, see 12.2 Wrapper interface.
-
If the Connection object is pooled and then reused, the user-added information that was set by using the setHADBAuditInfo method is not reused. In such a case, the status changes to the status that existed before the setHADBAuditInfo method was executed.