Derby provides the message, SQLState values, and error codes in SQL exceptions.
You can use methods of java.lang.Throwable to view the message issued by a SQL exception, including the SQLState and error messages.
Applications should also check for and process java.sql.SQLWarnings, which are processed in a similar way. Derby issues an SQLWarning if the create=true attribute is specified and the database already exists.