Exception

Hi,

I have a question.

I catch the SQLException and throw it as DataAccessException like below.

catch(SQLException ex)

{

throw new DataAccessException(sql.getErrorCode(),ex);

}

My question is I catch the DataAccessException and rethrow it as some other exception (say,ExceptionA).Catch ExceptionA and rethrow it as ExceptionB.

My question is

I want to get the sqlcode in ExceptionB.

Is there any way to do it other than passing the errorcdoe in all the exception constructors.

Thanks in advance,

[568 byte] By [ahtwoga] at [2007-10-2 4:05:30]
# 1
Throwable.getCause() ?
da.futta at 2007-7-15 23:28:14 > top of Java-index,Java Essentials,Java Programming...
# 2
Maybe I'm missing something. Why not just call ex.getErrorCode()?
Dick_Adamsa at 2007-7-15 23:28:14 > top of Java-index,Java Essentials,Java Programming...