Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet Works only for one row
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Rakesh Keerthi
Works only for one row
0 Answer(s)      2 years and 2 months ago
Posted in : JSP-Servlet


Hi,

My below code is working only if there is a single row. could you please help me in doing it for all the rows retrieved from the database.

<%@page import="java.util.concurrent.CountDownLatch"%>  
<%@include file="DBCon.jsp" %>  

<html>  
    <head><script type="text/javascript">  
       function invoke(but)  
            {  
                if(but==5)  
                {  
                    document.abc.action="Users_2.jsp";  
                }  
                else if(but==6)  
                {  
                    document.abc.action="Up_Query_DB.jsp";  
                }  
                    document.abc.submit();  
            }  
             function UnBloc1()  
            {  
                document.getElementById("updat1").style.display="block";  
                document.getElementById("Ans").style.display="block";  
            }  
        </script> </head>  
<body>  
    <table border="1px">  
<%  
try{  
    ps=con.prepareStatement("Select DBID,Query_Raised,TR from Scope1 where TR!='null' AND (Query_Answered is null OR Count is null)");  
    rs=ps.executeQuery();  
    out.println("<b>QueryRaised</b>");  
       while(rs.next())  

        {  
           %>  
                      <tr>  
                      <form name="abc" method="post" action="">  
                      <td><center><input type="text" value="<%=rs.getString("DBID")%>" readonly="readonly" id="xyz" name="xyz" size="100"></center></td>  
                      <td><input type="Submit" value="Resume" name="Resume" id="Resume" onClick="invoke(5)"></td>  
                      <td><input type="button" value="Update Answer" onClick="UnBloc1()"></td>  
                      <td><input type="text" name="updat1" style="display: none" id="updat1" style="border:hidden"/></td>             
                      <td><input type="Submit" value="Submit Answer" style="display:none" name="Ans" id="Ans" onClick="invoke(6)"/>  
                      </td>  

                      </form></tr>  

        <% }  
rs.close();  
con.close();  
}  
catch(Exception e)  
               {  
    out.println(e);  

}  
%>  
        </table></body></html>

please help me with it.

Thanks


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Works only for one row
Works only for one row   Hi, My below code is working only if there is a single row. could you please help me in doing it for all the rows retrieved from the database. <%@page import="java.util.concurrent.CountDownLatch
add one row after another
add one row after another  how i add one row after another on click of add button $(document).ready(function() { var counter = 2...) { alert("Only 10 textboxes allow"); return false
Advertisements
I have only one day to visit the Jaipur..
I have only one day to visit the Jaipur..  Hi, I have only a day to travel in Jaipur ..hence, bit worried about what to see first
value is inserted into the sql table through jsp-jdbc but not getting stored into the data base,only row is increasing.
value is inserted into the sql table through jsp-jdbc but not getting stored into the data base,only row is increasing.  <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8
i have one txt field and one button.when i entere any test in testfield then only button should be enabled.
i have one txt field and one button.when i entere any test in testfield then only button should be enabled.  i have one txt field and one button.when i entere any test in testfield then only button should be enabled. i need
i have one txt field and one button.when i entere any test in testfield then only button should be enabled. i need for this
i have one txt field and one button.when i entere any test in testfield then only button should be enabled. i need for this   i have one txt field and one button.when i entere any test in testfield then only button should
We just have one file on the hard disk. But we can create directories, sub-directories and files in that file only
We just have one file on the hard disk. But we can create directories, sub-directories and files in that file only  We just have one file on the hard... only
We just have one file on the hard disk. But we can create directories, sub-directories and files in that file only
We just have one file on the hard disk. But we can create directories, sub-directories and files in that file only  We just have one file on the hard... only
how to read the values for text and csv files and store those values into database in multiple rows..means one value for one row
table in multiple rows(which means one value for one row). eg: my file containes... row.... can any one help in this program? Regards, P.Divya   hi... into database in multiple rows..means one value for one row  Hai, I need
Hibernate criteria - how to use criteria to return only one element of an object instead the entire object.
Hibernate criteria - how to use criteria to return only one element of an object instead the entire object.  How to use criteria to return only one... projection to select one element of object. Here is an example to retrieve only name
Mysqldump one table - Taking dump of only one table
Use of mysqldump for taking backup of one table In this section you will see the example of mysqldump function which takes the backup of only one table... The mysqldump is very handy tool, it can be easily used to take the backup of only one
how can i define only one method from the interface. - Java Beginners
how can i define only one method from the interface.  If i am having an interface with 3 methods(declaration) . If i want to use only one method for defining without defining the other two methods. if it is possible then tell me
I want only one method goes to sleep but both method goes to sleep together
I want only one method goes to sleep but both method goes to sleep... 'o' to win if(PosTable[i][j]!=-1) //if we have 3 in a row...) //if we have 3 in a row if(c[PosTable[i][j]]==0
I want only one method goes to sleep but both method goes to sleep together
I want only one method goes to sleep but both method goes to sleep...' to win if(PosTable[i][j]!=-1) //if we have 3 in a row... have 3 in a row if(c[PosTable[i][j]]==0) //if position
I want to Transfer only 1/3rd of contents from one folder to other but my code is transferring all contents
I want to Transfer only 1/3rd of contents from one folder to other but my code is transferring all contents  private static void copyFilesRecursively(File src, File dest) throws IOException { if (src.isDirectory
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?  **struts.xml** <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software
row_id
name are same... i hav to change only one name.... is there somthing like rowid etc...row_id  sir i have created a table my_table with two rows n two... the first row and third column's name in sql server 2005 , kindly send me the query
row_id
name are same... i hav to change only one name.... is there somthing like rowid etc...row_id  sir i have created a table my_table with two rows n two... the first row and third column's name in sql server 2005 , kindly send me the query
VoIP Works
VoIP Works How VoIP Works If you've never heard of VoIP...;   How VoIP Works-Busting Out of Long Distance Rates... over Internet Protocol, and how VoIP works is actually quite revolutionary because
How TCP/IP works ?
How TCP/IP works ?  hello,, Can some body tell me how TCP/IP works?   hii, TCP/IP is just a protocol that allows different nodes on the network/Internet to share resources and without TRANSMISSION CONTROL PROTOCOL
delete row
delete row  how to delete row using checkbox and button in php...("sourabh", $link); $rows=mysql_query("select * from sonu"); $row=mysql...;/tr> <?php while($row=mysql_fetch_array($rows)) { ?> <tr>
jtable-adding a row dynamically
to add one more row dynamically as a new row 4th if the details are large.but every... row a new row 4th row shuld be formed any one can help me...jtable-adding a row dynamically  hi..i am doing a project
add image in a row of table
add image in a row of table  i have a table in which i have to add... jLabel.setIcon(new ImageIcon("E:/2.jpg"));.But when i pass this jlabel in the row it shows its properties instead of showing the image...please some one help me on this...my
add image in a row of table
add image in a row of table  i have a table in which i have to add... jLabel.setIcon(new ImageIcon("E:/2.jpg"));.But when i pass this jlabel in the row it shows its properties instead of showing the image...please some one help me on this...my
Works when run from desktop but....
Works when run from desktop but....  I used the code provided here for a pie chart using swing in Java, and when I saved it to my desktop, it ran fine, and worked as explained, but then I tried to add the same code to NetBeans
jtable insert row swing
jtable insert row swing  How to insert and refresh row in JTable?   Inserting Rows in a JTable example
didSelectRowAtIndexPath deselect row
didSelectRowAtIndexPath deselect row  Hi, In my UITableView application when user taps a row, how to deselect row? Thanks
insert and delete a row programmatically
insert and delete a row programmatically  How to insert and delete a row programmatically ? (new feature in JDBC 2.0
Why disable.this works in fireFox but n ot IE
Why disable.this works in fireFox but n ot IE  When I put this line of code in my program, it works beautifully in firefox, but does not submit when... this 6 days ago? Has no one encountered this before
Sql row retrieve - SQL
Sql row retrieve  Sir What are the sql statements so that I can retrieve rows from a table by specifying the row numbers such as row no.5 to 10, row no.13 to 20 like that. thanks Pabitra kr debanth. Guwahati. 
JTable duplicate values in row
JTable duplicate values in row  JTable duplicate values in row
Advertisements
 

 

 

DMCA.com