Results 1 to 4 of 4
Thread: dynamic insertion an deletion
- 07-07-2011, 10:14 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 3
- Rep Power
- 0
dynamic insertion an deletion
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.
<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>
Thanx in advance
- 07-08-2011, 09:31 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
And?
What's your problem?
(Apart from doing business logic ina JSP...that is, that db code should not be in there)
- 07-08-2011, 09:07 PM #3
Member
- Join Date
- Jul 2011
- Posts
- 3
- Rep Power
- 0
i want that whenever the submit button is pressed that row should be deleted from the problem table and inseted into solution table.....
- 07-10-2011, 09:48 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Similar Threads
-
File deletion won't work
By ozzyman in forum New To JavaReplies: 3Last Post: 04-01-2011, 02:04 PM -
Incremental Deletion
By tim in forum Forum LobbyReplies: 7Last Post: 05-18-2010, 08:39 AM -
Deletion Servlet
By Java Tip in forum Java TipReplies: 0Last Post: 12-25-2007, 11:23 AM -
Massive Hit Deletion Help please
By quickfingers in forum Java 2DReplies: 1Last Post: 12-24-2007, 07:49 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks