Nonstop Database, HiRDB Version 9 UAP Development Guide
The SQLWarning interface provides the following principal function:
If a method object triggers a warning report, an SQLWarning object is accumulated without an exception notice to that method object.
SQLWarning objects are accumulated as a chain linked to the method object (Connection, Statement, PreparedStatement, CallableStatement, or ResultSet) that triggers the warning reports.
To release accumulated SQLWarning objects explicitly, execute the clearWarnings method for the method object that triggered the warnings.
If the specified warning retention level indicates that warnings that occur during SQL execution are to be retained in the JDBC driver, the JDBC driver generates SQLWarning objects and retains warning information. In addition, a property can be used to specify warning retention for Connection objects.
The following table describes the conditions under which SQLWarning objects are generated.
Table 18-55 Conditions for generation of SQLWarning objects
SQL execution result | Warning retention specification for Connection object | ||||||
---|---|---|---|---|---|---|---|
Warning is retained | Warning is not retained | ||||||
Warning retention level | Warning retention level | ||||||
IGNORE | SQLWARN | ALLWARN | IGNORE | SQLWARN | ALLWARN | ||
SQLCODE is a value greater than 0 other than 100, 110, or 120 | Generated by an object other than a Connection object | No | No | Yes | No | No | Yes |
Generated by a Connection object | No | No | Yes | No | No | No | |
SQLWARN0 of the SQL Communications Area is W (except when SQLWARN6 is W) | Generated by an object other than a Connection object | No | Yes | Yes | No | Yes | Yes |
Generated by a Connection object | No | Yes | Yes | No | No | No | |
Warning occurs in the JDBC driver | Generated by an object other than a Connection object | No | Yes | Yes | No | Yes | Yes |
Generated by a Connection object | No | Yes | Yes | No | No | No |
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.