Hi all
First of all, Servlets are the best and so much fun to work with.
But I seem to be missing something in my overall understanding of error
handling for Servlets. How would I write the catch routine so that the
Servlet is not unloaded when an error occurs. I've included a part of my
class.
Any other examples would be great also.
Thanks.
Stef
public class Login extends HttpServlet {
Connection con = null;
public void init(ServletConfig config) throws ServletException {
super.init(config);
try {
// Load the Sybase driver
Class.forName("com.sybase.jdbc.SybDriver");
// Connect to db
con =
DriverManager.getConnection("jdbc:sybase:Tds:scote:2638","userid","password"
);
}
catch (ClassNotFoundException e) {
throw new UnavailableException(this, "Couldn't load
database driver");
}
catch (SQLException e) {
throw new UnavailableException(this, "Couldn't get
db connection");
}
}
.......
}
,, Stephane DeCoeli Cote
` > InterPro Expense System
||| ~ ||| w (925) 730-3717
-|||=oOOo====oOOo=|||-
||| \ / || \ / |||
\/ || \/
/ \
/ \
~ ~
I know I can, I think I can...Bah, I think I'll go ply Duke Nuken instead!
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html