S
sn1022
I am trying to use the RowSetDynaClass to retrieve
resultsets in a dynamic fashion, as can be seen in the
getRowSet() function here:
public RowSetDynaClass getRowSet() throws Exception
{
RowSetDynaClass rowset = null;
try{
//This is for the select list box
PreparedStatement prestmt = con.prepareStatement("SELECT " +
"EMPID, FNAME, LNAME " +
"FROM EMP");
ResultSet rs = prestmt.executeQuery();
rowset = new RowSetDynaClass(rs);
}finally{if(con!=null) con.close();}
return rowset;
}
(con is already set)
The problem is, the entire program crashes when I put in the following
try/catch block into the perform() method (the getRowSet() and the
action perform are in the same class) to call the RowSetDynaClass
getRowSet() function. The block is:
try{
RowSetDynaClass rowset = getRowSet(); //for complex
dynamic resultsets
request.setAttribute("rowset", rowset);
}catch(Exception e)
{System.out.println(e);
}
This block makes the program crash. Otherwise, the
program works perfectly. I was wondering if perhaps
there is some sort of syntactical error, etc. here?
Thank you for your help.
~Sunil
resultsets in a dynamic fashion, as can be seen in the
getRowSet() function here:
public RowSetDynaClass getRowSet() throws Exception
{
RowSetDynaClass rowset = null;
try{
//This is for the select list box
PreparedStatement prestmt = con.prepareStatement("SELECT " +
"EMPID, FNAME, LNAME " +
"FROM EMP");
ResultSet rs = prestmt.executeQuery();
rowset = new RowSetDynaClass(rs);
}finally{if(con!=null) con.close();}
return rowset;
}
(con is already set)
The problem is, the entire program crashes when I put in the following
try/catch block into the perform() method (the getRowSet() and the
action perform are in the same class) to call the RowSetDynaClass
getRowSet() function. The block is:
try{
RowSetDynaClass rowset = getRowSet(); //for complex
dynamic resultsets
request.setAttribute("rowset", rowset);
}catch(Exception e)
{System.out.println(e);
}
This block makes the program crash. Otherwise, the
program works perfectly. I was wondering if perhaps
there is some sort of syntactical error, etc. here?
Thank you for your help.
~Sunil