Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

16.2.9 SQLWarning class

Organization of this subsection
(1) Overview
(2) Notes

(1) Overview

The SQLWarning class provides the following function:

The SQLWarning object is accumulated without an issuance of exception in the method object that caused the warning.

(2) Notes

(a) Releasing the accumulated SQLWarning object

The SQLWarning object is accumulated by chain from the method object that caused the warning (Connection, Statement, PreparedStatement, CallableStatement, or ResultSet).

To explicitly release the accumulated SQLWarning object, you must execute clearWarnings from the object connecting the chain.

(b) SQLWarning object generation conditions

If the warnings caused by execution of SQL statements are to be retained in the JDBC driver according to the warning retention level specification, the SQLWarning objects are generated and the warning information is retained. The following table describes the SQLWarning generation conditions:

Execution result of SQL statement Warning retention level
IGNORE SQLWARN ALLWARN
SQLCODE is greater than 0 and is not 100, nor 110, nor 120 N N Y
SQLWARN0 in the SQL Communications Area is W (except when SQLWARN6 is W) N Y Y
Warning occurred in the JDBC driver N Y Y

Legend:
Y: Generated
N: Not generated

Note
You can specify the warning retention level using the HiRDB_for_Java_SQLWARNING_LEVEL property or the setSQLWarningLevel method. The default is SQLWARN.
(c) Warning message

The following table presents the messages that can be acquired from SQLWarning:

Condition Message acquired by getMessage
SQLWARN0 is W KFPJ01074-W
SQLWARN0 is '[Figure]' and SQLCODE is greater than 0 (except when SQLCODE=100, 110, or 120) KFPAXXXXX-X
Warning occurred in the JDBC driver KFPJXXXXX-W
(d) Batch updating

When warning occurs during updating of multiple rows during batch updating, only one SQLWarning is generated.