For those of you working on internationalizing the network client messages, you need to take care when choosing a SQL State for a new client messages (e.g. one that is not duplicated or closely duplicated in the engine's messages.properties file).
In most cases you can use "XN" which means a vendor-specific SQL State. However, if the error matches a predefined SQL State (either a class, subclass, or entire state) in the SQL2003 spec, you should use that. For example, an exception that affects the connection should use the prefix 08. A connection failure must be exactly 08006, connection does not exist 08003. The SQL State definitions can be found in section 23.1 of the SQL 2003 spec.
Somebody correct me if I'm missing something, but there is also an entire set of SQLStates required by DRDA which (in general) are currently not being set by the client code. These SQLStates are defined in Chapter 8 (Volume 1) of the DRDA spec. We will need to set the SQL State appropriately based on this spec in the org/apache/derby/client/net classes. I know this code is hard to parse through if you're new to DRDA, so please do send out email if you need help/guidance.
Note that doing this as correctly as possible is important for portability and also for future JDBC4 work where you create the appropriate SQLException subclass based on the SQL State...