cvissy:
As far as I know you can do something like that, but its not a good
idea to base your program flows on exceptions.
Rather have your program flow well structured to catch your exceptions
and deal with them immediately.
The example you gave leaves you open to a few problems because you are
making a general catch to all exceptions - maybe a
ClassNotFoundException occurs and you want to tell the user that they
can find the driver file, or a SQLException occurs and you must inform
the user that there is a problem with the JDBC:ODBC bridge. Neither of
these situations would be helped by simply catching a generic and
looping.
excellent advice. i agree with you. AP in ANG suggested a do loop, that
lets the catch increment ( counter++ ) and runs 3 tries. i like your idea
that the catch should be more discriminating and so i could build a
catch(exception e) case statement that only increments the loop for
specific conditions, or does a break; if there are conditions under which
the jdbc connect should not be retried.
--
http://geeks4dean.com
geeks for dean '04