| | |
Inserting table row values generated dynamically into database using JSP
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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.
<%@ 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.
![]() |
Similar Threads
- facing problem in database connectivity in jsp to mysql (JSP)
- Comparing Random generated values with Entered values in LogIn screen (ASP.NET)
- jsp code to send values to database (JSP)
- error due to accessing database connection using jsp (JSP)
- URGENT: JSP - StackOverFlow Error (JSP)
- javascript to add select button (JavaScript / DHTML / AJAX)
- retrieving ids from dynamically created controls in asp.net (ASP)
- Print 5 records per table row (see script) (Perl)
Other Threads in the JSP Forum
- Previous Thread: online exam source code in jsp
- Next Thread: Having problem in retrieveing values from pop-up window to main window
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web





