As of revision 371561 I have modified the client code so that client.am.SqlException no longer extends java.sql.SQLException.

What this means is that public methods throw java.sql.SQLException while internal methods throw client.am.SqlException. The public methods then catch SqlException and then use the method getSQLException() to throw a java.sql.SQLException for that SqlException. This is very similar to what happens on the engine side where StandardException is transformed into SQLException.

Sometimes internal methods call public JDBC methods. In these cases you have to have the following pattern:

try {
  publicMethod()
} catch ( SQLException sqle ) {
  throw new SqlException(sqle)
}

The SQLException is wrapped inside a SqlException and is unwrapped at a later point when the exception is thrown to the application. This prevents a chain of dependencies where if one internal method throws SQLException then many more have to throw it.

Comments and questions most welcome.

David
begin:vcard
fn:David W Van Couvering
n:Van Couvering;David W
org:Sun Microsystems, Inc.;Database Technology Group
email;internet:[EMAIL PROTECTED]
title:Senior Staff Software Engineer
tel;work:510-550-6819
tel;cell:510-684-7281
x-mozilla-html:TRUE
version:2.1
end:vcard

Reply via email to