In a JSP file I'm getting a:
Type expected (found 'try' instead)
Error while attempting to set up a connection. This leaves me with two questions. What is going wrong here? and more generally, what causes 'Type Expected' Errors in JSP? Since I can't find an explanation of the error in a Google search. Here's the code.
<%!
class ThisPage extends ModernPage
{
try{
Connection con=null;
PreparedStatement pstmt=null;
con = HomeInterfaceHelper.getInstance().getConnection();
pstmt = con.prepareStatement("sql goes here");
ResultSet rs = pstmt.executeQuery();
con.close();
}
catch (Exception e){
System.out.println("sql error: exception thrown");
}
}
%>
Edited to show more code