944,184 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 7964
  • JSP RSS
Nov 21st, 2006
0

Inserting table row values generated dynamically into database using JSP

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sonawane.prakas is offline Offline
2 posts
since Nov 2006
Oct 9th, 2007
0

Re: Inserting table row values generated dynamically into database using JSP

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.
Reputation Points: 1
Solved Threads: 0
Junior Poster in Training
hidash_in is offline Offline
85 posts
since Oct 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: online exam source code in jsp
Next Thread in JSP Forum Timeline: Having problem in retrieveing values from pop-up window to main window





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC