I am having problem printing result in the database.
I had a method that returns DataRow. And in display.jsp, i have a display method. I suspect that the method in display.jsp is causing the problem.
Can anyone help me?
public DataRow execSelectQuery(String sql){
try{
if (connection == null)
return null;
Statement s = connection.createStatement();
return new DataRow(s.executeQuery(sql));
}catch (SQLException e) {
e.printStackTrace();
return null;
}
void printData(DataRow data, javax.servlet.jsp.JspWriter out) throws IOException{
List list = new ArrayList();
while( (list = (List)data.nextRecord()) != null){
out.println(“<TR>”);
for (Iterator it=list.iterator(); it.hasNext(); ) {
out.println(“<TD>” + it.next() + “</TD>”);
}
out.println(“</TR>”);
}