I am using derby DB. I am trying to shutdown the database. I am receiving:
----- SQLException -----
SQL State: XJ004
Error Code: 40000
Message: Database '<db name>' not found.
I could find the SQL states listed here: http://db.apache.org/derby/docs/10.8/ref/rrefexcept71493.html
It lists XJ004: Database '<databaseName>' not found.
However, I can't find a list of Error Codes for derby.
Where is the list of error codes?
Derby uses the error code in the SQLException to express the exception severity.
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.
Derby 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 org.apache.derby.types.ExceptionSeverity:
The constants are:
/**
* NO_APPLICABLE_SEVERITY occurs only when the system was
* unable to determine the severity.
*/
public static final int NO_APPLICABLE_SEVERITY = 0;
/**
* WARNING_SEVERITY is associated with SQLWarnings.
*/
public static final int WARNING_SEVERITY = 10000;
/**
* STATEMENT_SEVERITY is associated with errors which
* cause only the current statement to be aborted.
*/
public static final int STATEMENT_SEVERITY = 20000;
/**
* TRANSACTION_SEVERITY is associated with those errors which
* cause the current transaction to be aborted.
*/
public static final int TRANSACTION_SEVERITY = 30000;
/**
* SESSION_SEVERITY is associated with errors which
* cause the current connection to be closed.
*/
public static final int SESSION_SEVERITY = 40000;
/**
* DATABASE_SEVERITY is associated with errors which
* cause the current database to be closed.
*/
public static final int DATABASE_SEVERITY = 45000;
/**
* SYSTEM_SEVERITY is associated with internal errors which
* cause the system to shut down.
*/
public static final int SYSTEM_SEVERITY = 50000;