dynamic delete and insertion in tables
hey... i have a problem..I am working on a problem management system..my code for a particular jsp page is as follows in this page i want to show the admin the already present records in the table named problem..and a submit solution button besides every row..whenever the admin clicks on the submit button that particular row should be deleted from this table and stored in another table named solution along with the solution which the admin has to enter.
print("code sample");
<table width="205%" border="0">
<tr >
<td width="105%" bgcolor="#FFFFFF"><table width="100%" height="100" border="1">
<tr>
<th width="5%" scope="row">EMPLOYEE NUMBER</th>
<td width="5%">EMPLOYEE NAME</td>
<td width="3%">MODULE NAME</td>
<td width="4%">PHONE NUMBER</td>
<td width="6%">EMAIL</td>
<td width="8%">PROBLEM DESCRIPTION</td>
<td width="5%">PROBLEM DATE</td>
<td width="5%">PROBLEM ID</td>
<td width="5%">SOLUTION</td>
</tr>
<% String login_name=(String)request.getAttribute("login");
`String cmd;
System.out.println(login_name);
if(login_name.equals("mehak"))
{
cmd="select * from problem where area='Hospitality'";
}
else if(login_name.equals("nipun"))
{
cmd="select * from problem where area='Gate Pass'";
}
else
{
cmd="select * from problem where area='Document Tracker'";
}
PreparedStatement psmt=con.prepareStatement(cmd);
ResultSet rs=psmt.executeQuery();
while(rs.next())
{
%>
<tr>
<th width="5%" scope="row"><%=rs.getString(1) %></th>
<td width="5%"><%=rs.getString(2) %></td>
<td width="3%"><%=rs.getString(4) %></td>
<td width="4%"><%=rs.getString(5) %></td>
<td width="4%"><%=rs.getString(6) %></td>
<td width="6%"><%=rs.getString(7) %></td>
<td width="8%"><%=rs.getString(8) %></td>
<td width="5%"><%=rs.getInt(9) %></td>
<% System.out.println(rs.getRow());%>
<td width="5%">
<form id="submit1" name="submit1" method="post" action="solution.jsp">
<select name="resolve">
<option value=<%rs.getRow(); %>>resolve</option>
</select>
<input type="submit" name="submit" id="resolve" value="submit"/>
</form>
</td>
</tr>
<% } %>
</table></td>
</tr>
</table>
View Answers
July 8, 2011 at 1:39 AM
THE above code is like this ..
<th width="5%" scope="row">EMPLOYEE NUMBER</th>
<td width="5%">EMPLOYEE NAME</td>
<td width="3%">MODULE NAME</td>
<td width="4%">PHONE NUMBER</td>
<td width="6%">EMAIL</td>
<td width="8%">PROBLEM DESCRIPTION</td>
<td width="5%">PROBLEM DATE</td>
<td width="5%">PROBLEM ID</td>
<td width="5%">SOLUTION</td>
</tr>
<% String login_name=(String)request.getAttribute("login");
String cmd;
System.out.println(login_name);
if(login_name.equals("mehak"))
{
cmd="select * from problem where area='Hospitality'";
}
else if(login_name.equals("nipun"))
{
cmd="select * from problem where area='Gate Pass'";
}
else
{
cmd="select * from problem where area='Document Tracker'";
}
PreparedStatement psmt=con.prepareStatement(cmd);
ResultSet rs=psmt.executeQuery();
while(rs.next())
{
%>
<tr>
<th width="5%" scope="row"><%=rs.getString(1) %></th>
<td width="5%"><%=rs.getString(2) %></td>
<td width="3%"><%=rs.getString(4) %></td>
<td width="4%"><%=rs.getString(5) %></td>
<td width="4%"><%=rs.getString(6) %></td>
<td width="6%"><%=rs.getString(7) %></td>
<td width="8%"><%=rs.getString(8) %></td>
<td width="5%"><%=rs.getInt(9) %></td>
<% System.out.println(rs.getRow());%>
<td width="5%">
<form id="submit1" name="submit1" method="post" action="solution.jsp">
<select name="resolve">
<option value=<%rs.getRow(); %>>resolve</option>
</select>
<input type="submit" name="submit" id="resolve" value="submit"/>
</form>
</td>
</tr>
<% } %>
</table></td>
</tr>
</table>
<table width="2122" height="104" border="0">
<tr>
<th width="24%" height="100" scope="row"> </th>
<td width="76%" bgcolor="black"><div align="center">
<table width="70%" border="0">
<tr>
<th scope="row"><a href="adminproblem.jsp">PROBLEM</a></th>
<td><p align="center"><a href="adminsolution.jsp">SOLUTION</a></p></td>
<td><div align="center"><a href="adminsuggestion.jsp">SUGGESTION</a></div></td>
</tr>
</table>
<table width="40%" border="0">
<tr>
<th class="copyright" scope="row">Copyright @ GAIL(INDIA) LIMITED.All right reserved.</th>
</tr>
</table>
</div></td>
<td width="0%"> </td>
</tr>
</table>
</body>
</html>
Ads
Related Tutorials/Questions & Answers:
dynamic delete and insertion in tables
dynamic delete and
insertion in tables hey... i have a problem..I am working on a problem management system..my code for a particular jsp page is as follows in this page i want to show the admin the already present records
dynamic delete and insertion in tables
dynamic delete and
insertion in tables hey... i have a problem..I am working on a problem management system..my code for a particular jsp page is as follows in this page i want to show the admin the already present records
Advertisements
insertion sort
insertion sort write a program in java using
insertion sort
insertion sort
insertion sort write a program in java using
insertion sort
insertion sort
insertion sort write a program in java using
insertion sort
insertion sort
insertion sort write a program in java using
insertion sort
insertion sort
insertion sort how many arrays needed for
insertion sort and why
Insertion into database
Insertion into database Hi,
I need code for inserting the multiple select box values into database.Please do send me the code.
Thanks for ur immediate replies its helping a lot
Insertion Sort Applet
Insertion Sort Applet I need
Insertion Sort Applet code was design by Dr. Daniel Liang
Please
Insertion Sort Timer
Insertion Sort Timer Welcome all
I wanna program in java find the timer of
insertion sort and find time complexity for random value
thanks all
JDBC ResultSet Delete Row Example
JDBC ResultSet
Delete Row Example:
Learn how to
delete row using ResultSet. We are also used ResultSet object
with update capability for
delete rows from database
tables. The following step
are use:
1. Create a database connection
SQL Server row comparison using two tables
SQL Server row comparison using two tables
insertion process are completed in table1.string comparison using table2 to table1 if any changes in these
tables and then upadated
Java insertion sort question
Java
insertion sort question I've got another program that I need help with. I am trying to write a Java method that accepts an array of strings, and sorts the strings using the
insertion sort algorithm. Then I need to write
Comparing tables
Comparing tables How to compare two or more
tables in the Mysql database using jdbc
Insertion Sort Problem
Insertion Sort Problem So I have this in a class file. It is supposed to be an
insertion sorter:
int min, index=0, temp;
for(int i=0;i<sorted.length;i++){
min=sorted[i];
for(int j=i+1;j<
Insertion of multiple row data for billing purpose.
Insertion of multiple row data for billing purpose. Hi ,
I have a hrml page .
with 4 input text field as a 4 column and 4-5 rows... is that the no of text field in row/column can be
dynamic.
so how can i insert all
data insertion and fetch 1
data
insertion and fetch 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type
To delete post
To
delete post How can I
delete my old post answer. I've posted 2 same answers by mistake
The DELETE Statement, SQL Tutorial
The
DELETE Statement
The
DELETE statement is used to
delete rows from a table.
database will update that is why deletion and
insertion of data will be
done.
Syntax
 
Purge Data from Mysql tables
to purge data from
tables.
but written procedure clear entire
tables data... THEN
LEAVE read_loop;
END IF;
DELETE FROM attendance_table WHERE confrefno= confRefNo;
DELETE FROM codr_detail_table WHERE confrefno
ModuleNotFoundError: No module named 'tables'
ModuleNotFoundError: No module named '
tables' Hi,
My Python... '
tables'
How to remove the ModuleNotFoundError: No module named '
tables'... to install padas library.
You can install
tables python with following command
delete jsp
delete jsp <%@ page language="java" contentType="text/html...; charset=ISO-8859-1">
<title>
Delete Student</title>
</head>...;/Controller">
<input type="hidden" name="page" value="
delete"/>
<
dynamic polymorphism
dynamic polymorphism Develop with suitable hierarchy, classes for Point, Shape, Rectangle, Square, Circle,
Ellipse, Triangle, Polygon, etc. Design a simple test application to demonstrate
dynamic polymorphism
SQL All Tables
SQL All
Tables
SQL All
Tables is used to show all the
tables in database.
Understand with Example
The Tutorial illustrate an example from 'SQL All
Tables'. To understand