JSP implementation tree structure (4) -- insert page orgInsert. jsp

Source: Internet
Author: User
// OrgInsert. jsp insert page
<% @ Include file = "connectionDB. jsp" %>
<%
Request. setCharacterEncoding ("big5 ");
String fDep = request. getParameter ("fDep ");
String dep = request. getParameter ("dep ");
// Out. println (fDep );
// Out. println (dep );
Boolean autoCommit = conn. getAutoCommit ();
Try {
Conn. setAutoCommit (false );
String queryF = "select total" +
"From ngb_org" +
"Where name = '" + fDep + "'Order by total ";
// Out. println (queryF + "<br> ");
String tempF = null;
PreparedStatement ps = conn. prepareStatement (queryF );
ResultSet rsw.ps.exe cuteQuery ();
While (rs. next ())
{TempF = rs. getString ("total ");}
// Out. println (tempF + "<br> ");
Char tempFa = tempF. charAt (0 );
Char tempFb = tempF. charAt (1 );
Char tempFc = tempF. charAt (2 );
Char tempFd = tempF. charAt (3 );
Char tempFe = tempF. charAt (4 );
Char tempFf = tempF. charAt (5 );
Int tempFg = Integer. parseInt (tempF. substring (4, 6 ));
String tempC = null;
String tempCC = null;
If (tempFd = 'a ')
{TempC = "% B %"; tempCC = "B ";}
Else if (tempFd = 'B ')
{TempC = "% C %"; tempCC = "C ";}
Else if (tempFd = 'C ')
{TempC = "% D %"; tempCC = "D ";}
Else if (tempFd = 'd ')
{TempC = "% E %"; tempCC = "E ";}
String queryColumn = "select count (*)" +
"From ngb_org" +
"Where total like '" + tempC + "'";
String queryDefference = "select total" +
"From ngb_org" +
"Where total like? ";
Int totalNumber = 0;
// Configure
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.