db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: [jira] Commented: (DERBY-254) SQLStates for SQLExceptions thrown from the client should not be null and should match embedded where possible
Date Wed, 05 Oct 2005 20:41:05 GMT
Kathey Marsden wrote:

>>Daniel John Debrunner commented on DERBY-254:

>>I'm not sure Derby should be recommending checking the error code for an exception,
I don't think today it's specified as any part of the documentation that the error code is
a severity. Use of the error code is vendor specific and will result in non-portable programs.
JDBC 4.0 is addressing this with the sub-classing of SQLException.
> So with the product as is, (before JDBC 4.0) what is the recommended way
> to check if an exception makes a connection invalid.  Currently I know
> there are users that are using the error codes (Exception Severity)?

Execute a simple statement against the connection, e.g. VALUES 1.
Is the severity error code even portable between embedded and the client

> The errorcode is documented as severity for embedded.
> http://db.apache.org/derby/docs/10.0/manuals/develop/develop86.html#IDX717

Hmmm, I thought all that had been removed since it does encourage
non-portable JDBC programming. For example the class
org.apache.derby.types.ExceptionSeverity referenced in that page no
longer exists and is not part of the published javadoc for Derby.


View raw message