I have a table within that i update particular cell and want to store the update value into table after clicking save button My page is JSP page

The below program is for changing thw values in the database using jsp

<%@ page contentType="text/html" %>
<%@ page session="true" %>
<%@ page language="java" %>
<%@ page autoFlush="true" import="com.hurix.mhlncms.*, java.util.*"%>
<%@ page import="java.util.*,java.io.*"%>
<jsp:useBean id="hdbc" class="com.hurix.mhlncms.cmslib.cmsdbconnection.HurixDbconnection" scope="application" />
<jsp:useBean id="mis" class="com.hurix.mhlncms.pmsempmodifycomdetails" scope="page" />
<script language="JavaScript">    

  function callMainPage(pmsempid){


      if (navigator.userAgent.indexOf('Win') !=-1)
      {
        if(navigator.appName == 'Netscape') 
        {

          document.location.href="EmpModifyper.jsp?pmsempid="+pmsempid+" ";

        }
        else if(navigator.appName == 'Microsoft Internet Explorer') 
        {   

          document.location.href="EmpModifyper.jsp?pmsempid="+pmsempid+" ";
          }     
      }
      else //if (navigator.userAgent.indexOf('Mac') !=-1)
      {
        if(navigator.appName == 'Netscape') 
        {

          document.location.href="EmpModifyper.jsp?pmsempid="+pmsempid+" ";

        }
        else if(navigator.appName == 'Microsoft Internet Explorer') 
        {

          document.location.href="EmpModifyper.jsp?pmsempid="+pmsempid+" ";
        }     
      }
  }
</script>

<%
     mis.setHurixDbconnection(hdbc); 

     String pmsempid = request.getParameter("pmsempid");

     Vector insertcom = new Vector(); //fetch the values from key.jsp file

        insertcom.addElement(request.getParameter("pmsempdesignation"));
        insertcom.addElement(request.getParameter("pmsempdepartment"));
        insertcom.addElement(request.getParameter("pmsemppraticearea"));
        insertcom.addElement(request.getParameter("pmsemplevel"));
        insertcom.addElement(request.getParameter("pmsempband"));
        insertcom.addElement(request.getParameter("pmsempjoptype"));
        int status = mis.updateRecord(insertcom,pmsempid);

%>
<script language="JavaScript">callMainPage('<%=pmsempid%>'); </script>

and name this program and call this program in the main page by giving
<onsubmit="XXX.jsp">

ckech this program and leave a comment.

Edited 3 Years Ago by pyTony: fixed formatting

This article has been dead for over six months. Start a new discussion instead.