P
parkarumesh
Hi,
I have written a function as follows
public String fetchName(String query) throws Exception
{
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
rs.next();
return (rs.getString(1));
}
I've handled the for exceptions here using "throws Exception". Inspite
of that when i call it from other function and in that funtion no
exception need to be handled, compiler gives errror.
Following is the calling funtion
public String checksubAction(String action)
{
String retValue=" ";
String query="";
query = "select Title from dbo.Folder where Folder_Id="+folderId;
retValue = dataBaseObj.fetchName(query);
}
but when i write it in try-catch block, no errror is given.
Why is it that inspite of handling exception(s) in the called function,
we need to handle them in calling functions.
Thanks
I have written a function as follows
public String fetchName(String query) throws Exception
{
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
rs.next();
return (rs.getString(1));
}
I've handled the for exceptions here using "throws Exception". Inspite
of that when i call it from other function and in that funtion no
exception need to be handled, compiler gives errror.
Following is the calling funtion
public String checksubAction(String action)
{
String retValue=" ";
String query="";
query = "select Title from dbo.Folder where Folder_Id="+folderId;
retValue = dataBaseObj.fetchName(query);
}
but when i write it in try-catch block, no errror is given.
Why is it that inspite of handling exception(s) in the called function,
we need to handle them in calling functions.
Thanks