The JDBC driver returns SQLExceptions for all errors from Derby. If the exception originated in a user type but is not itself an SQLException, it is wrapped in an SQLException. Derby-specific SQLExceptions use SQLState class codes starting with X. Standard SQLState values are returned for exceptions where appropriate.
Unimplemented aspects of the JDBC driver return an SQLException with a message starting "Feature not implemented" and an SQLState of XJZZZ. These unimplemented parts are for features not supported by Derby.
Derby supplies values for the message and SQLState fields. In addition, Derby sometimes returns multiple SQLExceptions using the nextException chain. The first exception is always the most severe exception, with SQL-92 Standard exceptions preceding those that are specific to Derby.
For information on processing SQLExceptions, see the Derby Developer's Guide.