
public String executeStudentInsert(HttpServletRequest request ) throws ClassNotFoundException, SQLException
{
StudentBean beanObj = new StudentBean();
beanObj.setStudentName(request.getParameter("Name"));
beanObj.setStudentAge(request.getParameter("Age"));
beanObj.setStudentCollege(request.getParameter("College"));
studentInsert studInsObj = new studentInsert();
String result = studInsObj.studentIns(beanObj);
return result;
}
public ArrayList executeStudentSearch(HttpServletRequest request ) throws ClassNotFoundException, SQLException
{
StudentBean beanObj = new StudentBean();
ArrayList<String> ArrObj = new ArrayList<String>();
beanObj.setStudentId(request.getParameter("ID"));
StudentSearch studInsObj = new StudentSearch();
ResultSet rs = studInsObj.studentSearch(beanObj);
while(rs.next())
{
for(int temp=1;temp<5;temp++)
{
String str = rs.getString(temp);
ArrObj.add(str);
}
}
return ArrObj;
}
public String executeStudentUpdate(HttpServletRequest request ) throws ClassNotFoundException, SQLException
{
StudentBean beanObj = new StudentBean();
beanObj.setStudentId(request.getParameter("searchID"));
beanObj.setStudentName(request.getParameter("UpdateName"));
beanObj.setStudentAge(request.getParameter("UpdateAge"));
beanObj.setStudentCollege(request.getParameter("UpdateCollege"));
StudentUpdate studUpdObj = new StudentUpdate();
String result = studUpdObj.studentUpd(beanObj);
return result;
}
public String executeStudentDelete(HttpServletRequest request ) throws ClassNotFoundException, SQLException
{
StudentBean beanObj = new StudentBean();
beanObj.setStudentId(request.getParameter("DeleteId"));
StudentDelete studDelObj = new StudentDelete();
String result = studDelObj.studentDel(beanObj);
return result;
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.