Is this kind of what you mean.
try{
String a = "";
if(a.equals("")){
throw new Exception("I am the root exception");
}
}catch(Exception e){
StackTraceElement[] se = e.getStackTrace();
for(int i=0; i<se.length; i++){
System.out.println(se[i].toString());
}
----- Original Message -----
From: "subbu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 17, 2003 2:15 AM
Subject: Nested Exception Handling
Is it possible to do Exception handling using nested Exception....
Example :
ie: com.ibm.websphere.cpi.CPIException: java.sql.SQLException: ORA-02291:
integrity constraint (xxx.yyy_Szzzzz_FK) violated - parent
key not found
; nested exception is:
java.sql.SQLException: ORA-02291: integrity constraint
in this above stacktrace i need to write exception handling for only
java.sql.SQLException
Disclaimer: This communication is for the exclusive use of the intended
recipient(s) and shall not attach any liability on the originator or ITC
Infotech India Ltd./its Holding company/ its Subsidiaries/ its
GroupCompanies. If you are the addressee, the contents of this e-mail are
intended for your use only and it shall not be forwarded to any third party,
without first obtaining written authorisation from the originator or ITC
Infotech India Ltd./ its Holding company/its Subsidiaries/ its Group
Companies. It may contain information which is confidential and legally
privileged and the same shall not be used or dealt with by any third party
in any manner whatsoever without the specific consent of ITC Infotech India
Ltd./its Holding company/ its Subsidiaries/ its Group Companies.
=========================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com