db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "JDBC error messages and SQL States" by TomohitoNakayama
Date Wed, 05 Oct 2005 10:56:52 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The following page has been changed by TomohitoNakayama:
http://wiki.apache.org/db-derby/JDBC_error_messages_and_SQL_States

------------------------------------------------------------------------------
  
  Structure of internal behaviors of program may be different , whether it was happen in embedded
or in network environment , even if they are very identical error. 
  
- Should we express the difference in the error message ? Or should not ? [
+ Should we express the difference in the error message ? Or should not ? 
   * I think expressing such differences in error messages would help programmer who get the
error message ['''TMNK''']
  
- ----
  
+ == Identical error in engine layer can happen both in embedded mode and network mode ==
+ Not yet clear.
+ Now discussing in derby-dev@db.apache.org
- Hi, Tomohito.  I am dealing with the null SQL states in the client driver as part of my
work on internationalizing the messages.  I think it makes a lot of sense for the SQL states
to match between network client and embedded client.  I noticed, for instance, test code that
did something like:
- 
- {{{
- if ( client driver is embedded )
-   look for SQL State NNNN
- else
-   look for SQL State YYYY
- end if
- }}}
- 
- This seems silly.
- 
- 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.
- 
- 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.
- 
- I think we should keep the SQL states (and the error messages) identical where the error
is identical between the network client and the engine.
- 
- Also, I would like to recommend that this discussion be moved to or linked to from the JIRA
issue around SQL states -- [http://issues.apache.org/jira/browse/DERBY-254 DERBY-254]
- 
- David VC
  
  == Another remarkable point here ==
  

Mime
View raw message