Tuesday, 12 June 2012

passing two parameter in update query using OADBTransaction Class


 public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);

    if(pageContext.getParameter("SubmitComments")!=null){
   OAMessageTextInputBean  tibnewno = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("newrno");
   String reqno=(String)tibnewno.getValue(pageContext);

   OAMessageTextInputBean  tibhrcommet = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("hrcomments");
   String hrcoment=(String)tibhrcommet.getValue(pageContext);
 
   System.out.println("Do the Updatation regarding EmpRequisitionNo.==="+reqno);
   OAApplicationModule am=pageContext.getApplicationModule(webBean);

try{
Connection conn =am.getOADBTransaction().getJdbcConnection();
Statement stmt = conn.createStatement();
int r=stmt.executeUpdate("update employeerequisitiondetail  set commentsByDepttNHR='"+hrcoment+"' where employeerequistionno="+reqno+" ");

                                                             
System.out.println("I am in TOP ProcessFormRequest  Succesfully if result ====="+r);
am.getOADBTransaction().commit();
stmt.close();
}catch(Exception e){System.out.println(e.toString());}
    }

No comments:

Post a Comment