– Is there any problem with these codes in processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException.
– it seems that it execute the “else” rather than executing the “if(temp…(“select”))” statement when i have a sql query =”select * from Business”.
<–code starts here–>
😀
if(temp.equalsIgnoreCase(“select”)){
data= db.execSelectQuery(request.getParamete(“sqlstatement”));
request.getSession().setAttribute(“data”, data);
request.getRequestDispatcher(“/WEB-INF/pages/DisplayData.jsp”).forward(request, response);
}else if ((temp.equalsIgnoreCase(“Update”) || temp.equalsIgnoreCase(“Insert”) || temp.equalsIgnoreCase(“Delete”))){
updatedata= db.execUpdateQuery(request.getParameter(“sqlstatement”));
Integer intobj = new Integer(updatedata);
request.getSession().setAttribute(“intobj”, intobj);
request.getRequestDispatcher(“/WEB-INF/pages/DisplayCUDData.jsp”).forward(request, response);
}
else{
request.getRequestDispatcher(“/WEB-INF/pages/NoData.htm”).forward(request, response);
}
}
😕
<—code ends here–>