Home Answers Viewqa JSP-Servlet dynamic delete and insertion in tables

 
 


mehak ahuja
dynamic delete and insertion in tables
1 Answer(s)      a year and 10 months ago
Posted in : JSP-Servlet

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">&nbsp;</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%">&nbsp;</td>
  </tr>
</table>

</body>
</html>









Related Pages:
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
dynamic multiplecheckbox values insertion - JSP-Servlet
dynamic multiplecheckbox values insertion  hi How to insert dynamically generated checkbox values to store in mysql data base using jsp?  Hi Friend, Try the following code: 1)checkbox.jsp: Name
Dynamic form
Dynamic form  I need to make a dynamic form using jsp for example, i will need a list of items which when we select one option another list...; For the above code, we have created two database tables: CREATE TABLE `country
dynamic form
dynamic form  I need to make a dynamic form using php, for example, i will need a list of items which when we select one option another list... need to create following database tables. CREATE TABLE `country` ( `id
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
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
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
The DELETE Statement
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    
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
Dynamic include of multiple files
Dynamic include of multiple files  I want to include a series... } )) The idea is that the list of tables to be built will change pretty often, and by simply updating the list of filenames, I can change which tables are built
Dynamic Proxies - Short Tutorial
Dynamic Proxies - Short Tutorial 2001-01-18 The Java Specialists' Newsletter [Issue 005] - Dynamic Proxies - Short Tutorial Author: Dr. Christoph G... from me, here is a "Short Tutorial to the Java2 platform Dynamic Proxy
Dynamic select box - Ajax
Dynamic select box  Hi, I Have almost completed the task mentioned below.. But I feel your support would make this 100% pakka.. I have two... used the tables country(country_id(Number),countryname(Text)) and city(cityid
dynamic drop down
dynamic drop down   I have created 2 drop downs in jsp.1 for department and other for its related designation.that means if I select a department..., create tables dept and designation: CREATE TABLE `dept
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    
B+ tree JAVA source code for implementing Insertion and Deletion - Java Beginners
B+ tree JAVA source code for implementing Insertion and Deletion  Can anyone plz mail de B+ tree JAVA source code for implementing Insertion...(); System.out.println(root.Search(12)); System.out.println("Delete value is: " + root.Delete
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
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
Create Dynamic Table using Hubernate
Create Dynamic Table using Hubernate  Thank's for reading my Post. I am new to hibernate.all i need some clarification and explaination. Problem 1... the creating and updating tables. I saw somewhere in internet they use spring
DELETE
DELETE   I AM DOING IT IN MYSQL. DELETE FROM EMP WHERE SAL>(SELECT SAL FROM EMP WHERE ENAME='MILLAR') AND ENAME='ALLEN'; THIS IS GIVING THE FOLLOWING ERROR Error Code : 1093 You can't specify target table 'EMP
Dependant & dynamic drop down list
Dependant & dynamic drop down list  I don't know this should be in this or AJAX forum. I have one dynamic drop down list from data base (working... created two database tables: CREATE TABLE `country
delete
delete  how delete only one row in the database using jsp.database... type="button" name="edit" value="Delete" style="background-color:red;font-weight... = conn.createStatement(); st.executeUpdate("DELETE FROM employee WHERE empid
Nest tables within tables
Nest tables within tables  Can I nest tables within tables
Insertion Sort Applet
Insertion Sort Applet  Please All , I need Insertion sort applet program
Insertion Sort Applet
Insertion Sort Applet  I need Insertion Sort Applet code was design by Dr. Daniel Liang Please
insertion sort applet code
insertion sort applet code  i need Insertion Sort Applet Program
tables for layout
tables for layout  Are there any problems with using tables for layout
tables for layout
tables for layout  Are there any problems with using tables for layout
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
File insertion into oracle database
File insertion into oracle database  How to Read and Insert a file (any format) into a Oracle database
hibernate insertion problem - Hibernate
hibernate insertion problem  Hi , Thanks for the material .Its very gud . when i run FirstExample.java i get the message insertion has been done int the table contact . but whne i look into database data is not inserted
Dependant & dynamic drop down list - Follow up
Dependant & dynamic drop down list - Follow up  Thanks for your answer. As per your answer This will select only ONE row (country) from first drop...){ System.out.println(e); } %> For the above code, we have created two database tables
CSV tables
CSV tables  hello, What are CSV tables?   hii, CSV Tables cannot be indexed.CSV Tables are the special tables, data for which is saved into comma-separated values files
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
insertion in SQL - SQL
insertion in SQL  Hi! Everybody... i have a problem with sql insertion. When i am inserting values through command i.e. insert into employee values(,,,,); here i want to insert ' in employee name column of database
Drop Table in Database
;  The Drop Statement in SQL Command is used to delete or remove indexes, tables and database. The Syntax used for Drop table statement in database is given as: Drop Table table_ Name; The above syntax is used to delete a table
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<
DYNAMIC BINDING
DYNAMIC BINDING  WHAT IS DYNAMIC BINDING
Insertion Sort - Java Beginners
Insertion Sort  Hello rose india java experts.If you don't mind.Can you help me.What is the code for Insertion Sort and Selection Sort that displays LETTERS in alphabetical order from A to Z. Thank you.Hope you gonna helpme
insertion error - JSP-Servlet
insertion error  my first jsp page : In this i m getting all the values through a method called getAllDetails,the values are getting inserted but the problem is i have created frames , when i clicking on the link book halls
insertion in SQL - SQL
insertion in SQL  Query is "insert into employee values('"+eno+"','"+ename+"');" in the ename place we will get employee names such as John's Peter,Peter's Johnson etc.... i am not able to insert this kind of names
javascript variable value insertion in DB
javascript variable value insertion in DB  how can I insert javascript variable value into database using php
data insertion and fetch 1
data insertion and fetch 1  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ <%@page contentType="text/html" pageEncoding="UTF-8"%> Location Fill Up Your Details <center> <form action
dynamic report
dynamic report  i need complete code for generating dynamic report in jsp

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.