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 driver? > 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. Dan.