Batch update of data using jsp

Source: Internet
Author: User
I have a program here. I wonder if I can help you !!
<--
This is the a1.jsp page program.
-->
<Jsp: useBean id = "pool" scope = "page" class = "SQL _link. SQL _link"/> // reference the database connection bean
<Html>
<Head>
<Link rel = "stylesheet" type = "text/css" href = "main.css">
<Title> Untitled </title>
</Head>
<Body>
<Form name = f1 action = "a2.jsp" method = "post">
<Table>
<% ResultSet rs = null;
Int I = 0;
Rs = pool. Query ("select id, name, gender from database name ");
While (rs. next ())
{
I ++;
String tax = "ta" + String. valueOf (I );
String tbx = "tb" + String. valueOf (I );
String tcx = "tc" + String. valueOf (I );
%>
<Tr>
<Td>
<Input type = hidden name = "<% = tcx %>" value = "<% rs. getInt (1) %>">
<Input type = text name = "<% = tax %>" value = "<% = rs. getString (2) %>">
</Td>
<Td>
<Input type = text name = "<% = tbx %>" value = "<% = rs. getString (3) %>">
</Td>
</Tr>
<%
}
%>
<Input type = hidden name = hh value = "<% = I %>">
</Table>
</Form>
</Body>
</Html>
//------------------------------------------------------------------------------
// A2.jsp receives data from the a1.jsp page and saves it to the database !!
<Jsp: useBean id = "pool" scope = "page" class = "SQL _link. SQL _link"/> // reference the database connection bean
<Html>
<Head>
<Link rel = "stylesheet" type = "text/css" href = "main.css">
<Title> Untitled </title>
</Head>
<Body>
<%
Int key = integer. parseInt (request. getParameter ("hh "));
For (int I = 1; I <= key; I ++)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.