[ http://issues.apache.org/jira/browse/DERBY-254?page=comments#action_12331399 ]
Daniel John Debrunner commented on DERBY-254: --------------------------------------------- David said: > What I am doing (we'll see if people have comments on this) is defining a new > severity for exceptions thrown by the network client. Since the exception > severity is mapped to the SQLException error code, the application programmer > can check the error code to determine if it's a network client exception. 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. David also said: > The other way they can distinguish is to see what the instance of the class > is. It will be an instance of org.apache.derby.impl.jdbc.EmbedSQLException if > it came from the embedded driver, and an instance of > org.apache.derby.client.am.SqlException if it comes from the network client. No, this is not part of any documented api., there are no guarantees that any exception thrown by Derby embedded or the network client will be any speciific class. I would like us to use SQLException directly and I think JDBC 4.0 will force us in that direction (using SQLException and the other exception classes declared by JDBC 4.0) > SQLStates for SQLExceptions thrown from the client should not be null and > should match embedded where possible > -------------------------------------------------------------------------------------------------------------- > > Key: DERBY-254 > URL: http://issues.apache.org/jira/browse/DERBY-254 > Project: Derby > Type: Improvement > Components: Network Client > Versions: 10.2.0.0, 10.1.1.0 > Reporter: Kathey Marsden > Assignee: David Van Couvering > Fix For: 10.2.0.0 > > SQLExceptions generated from the client tend to have a null SQLState. An > evaluation of the SQLExceptions thrown by the client needs to be performed > and match embedded where possible. > If this does not happen before the 10.1 release, it would be good to document > that SQLStates in the client will change for future releases -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
