Inserting table row values generated dynamically into database using JSP

Reply

Join Date: Nov 2006
Posts: 2
Reputation: sonawane.prakas is an unknown quantity at this point 
Solved Threads: 0
sonawane.prakas sonawane.prakas is offline Offline
Newbie Poster

Inserting table row values generated dynamically into database using JSP

 
0
  #1
Nov 21st, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 85
Reputation: hidash_in has a little shameless behaviour in the past 
Solved Threads: 0
hidash_in's Avatar
hidash_in hidash_in is offline Offline
Junior Poster in Training

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

 
0
  #2
Oct 9th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC