Anurag Shekhar wrote:

>>
> I checked the classes calling using Util to get the SQLException either
> already have the reference of InternalDriver or they can be easily
> modified to have this reference. There appears to be 1 problem class
> EmbedResultSetMetaData.
> 
> EmbedResultSetMetaData is being instantiated staticly from many classes
> (eg  org.apache.derby.diag.StatementDuration, StatementCache). I am not
> sure if its safe to assume that InternalDriver variable will be
> initialized before these classes are loaded.

Would it be acceptable for there to continue to be a static method in
Util that worked as it does today, always returning a
java.sql.SQLException? This method would have sanity checks to ensure
that the SQLState passed in did not start wiht any of the special values
that require specific sub-classes of SQLException. Then cases like
EmbedResultSetMetaData could use that method as the exeception it raises
does not have one of the special SQL states.

Of course this would only work until sometime in the future when
additional special codes are created, but as Tim Bray likes to say don't
over engineer now, "You ain't going to need it".

Dan.


Reply via email to