How can I catch an error from a Connection failed?
This is my code...
public void init(ServletConfig conf) throws ServletException {
super.init(conf);
try{
String driver = (String)getServletContext().getAttribute("db_driver"
String user = (String)getServletContext().getAttribute("db_adara_user"
String pwd = (String)getServletContext().getAttribute("db_adara_pwd"
String dbstring = (String)getServletContext().getAttribute("db_adara_string"
Class.forName(driver);
con = DriverManager.getConnection(dbstring,user,pwd);
}catch(Exception e) {
What can I do here?
I wanna give a message to user "Connection failed".
}
}
Thanks!
Renata Prates Markert
This is my code...
public void init(ServletConfig conf) throws ServletException {
super.init(conf);
try{
String driver = (String)getServletContext().getAttribute("db_driver"
String user = (String)getServletContext().getAttribute("db_adara_user"
String pwd = (String)getServletContext().getAttribute("db_adara_pwd"
String dbstring = (String)getServletContext().getAttribute("db_adara_string"
Class.forName(driver);
con = DriverManager.getConnection(dbstring,user,pwd);
}catch(Exception e) {
What can I do here?
I wanna give a message to user "Connection failed".
}
}
Thanks!
Renata Prates Markert