Cloudscape Exception Messages and SQL States
Page 2 of 3

Understanding SQLExceptions

The JDBC driver returns SQLExceptions for all errors from Cloudscape. If the exception originated in a user type but is not itself an SQLException, it is wrapped in an SQLException. Cloudscape-specific SQLExceptions use SQLState class codes starting with X. Standard SQLState values are returned for exceptions where appropriate.

Cloudscape database exceptions are classified by severity. The severity of an SQLException is available through the getErrorCode method call on the SQLException. The severities are summarized below. For more information, check the javadoc for COM.cloudscape.types.JBMSExceptionSeverity:

  • Statement Severity--the effects of the current statement, if any, on persistent data are undone.
  • Transaction Severity--the effects of the current transaction on persistent data are undone; a rollback is performed.
  • Session Severity--a rollback is performed and the current session is terminated. This closes the current connection.
  • System Severity--the system is shut down. All uncommitted transactions are rolled back.

Cloudscape provides a class, COM.cloudscape.database.JBMSException, for checking the severity of an exception.

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 Cloudscape.

Cloudscape supplies values for the message and SQLState fields. In addition, Cloudscape 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 Cloudscape.

For information on processing SQLExceptions, see Working with Cloudscape SQLExceptions in an Application in the Cloudscape Developer's Guide.