I'm having a weird problem with handling of SQLException. I have a caller method inside which i'm calling a called method. The code inside the called method includes some jdbc stuff and can potentially throw an SQLException.
Please see below - ************************************************* Class A{
public void callerMethod(){
try{ new B().calledMethod(); ..... // some other code here }catch(SQLException sqle) { sqle.printStackTrace(); } }
Class B{
public void calledMethod()throws SQLException{
try{ // some jdbc calls here }catch(SQLException sqle) { throw sqle; } } ******************************************************
Now, the weird part is that the classes get compiled in WSAD environment, but not in standalone WebSphere AppServer environment, with the following error during compilation -
javac - callerMethod() "java.lang.Exception" should be handled or thrown
Jayadev Pulaparty
Ranch Hand
Joined: Mar 25, 2002
Posts: 645
posted
0
Any replies please.
Thanks.
Denis Spirin
Ranch Hand
Joined: Mar 22, 2004
Posts: 72
posted
0
I have one question: How is it related to Sun Certified Java Developer Exam?