DB2 Version 9.7 for Linux, UNIX, and Windows

Handling SQL errors and warnings in SQLJ applications

SQLJ clauses throw SQLExceptions when SQL errors occur, but not when most SQL warnings occur.

SQLJ generates an SQLException under the following circumstances:
  • When any SQL statement returns a negative SQL error code
  • When a SELECT INTO SQL statement returns a +100 SQL error code

You need to explicitly check for other SQL warnings.