Simple score Query System

Source: Internet
Author: User

Create a database (std. mdb) with two tables 1.pw( password table). 2. score two tables.
Create two Jsp files
Enter. jsp (logon page, used for positive identity verification)
-----------------------------------------------
<% @ Page contentType = "text/html; charset = gb2312" %>
<Html>
<Title> logon with personal score query </title>
<Body>
<Center>
<Font color = blue size = 4> <B> <I>
Enter your student ID and password </B> </I>
</Font>
<Hr>
<Form action = "result. jsp" method = "post">
<Table border = "1">
<Tr> <th bgcolor = "yellow"> Student ID </th> <td>
<Input type = "text" size = 10 name = "number"> </td> </tr>
<Tr> <th bgcolor = "yellow"> password </th> <td>
<Input type = "password" size = 10 name = "password"> </td> </tr>
<Tr> <td colspan = "2" align = "center">
<Input type = "submit" vaule = "query"> </td> </tr>
</Table>
</Form>
<Font color = "red">
<%
String error = request. getParameter ("errortype ");
If (error! = Null)
{
Int errortype;
Errortype = Integer. parseInt (error );
Switch (errortype)
{
Case 1: out. println ("Enter your student ID! "); Break;
Case 2: out. println ("enter the password! "); Break;
Case 3: out. println ("wrong, no such person! "); Break;
Case 4: out. println ("Incorrect password! "); Break;
Default:
}
}
%>
</Font>
</Body>
</Html>
Result. jsp (query result execution)
--------------------------------------------
<Html>
<Title> query result </title>
<Body>
<% @ Page contentType = "text/html; charset = gb2312" %>
<% @ Page import = "java. SQL. *" %>
<%
String num = request. getParameter ("number ");
String password = request. getParameter ("password ");
Int errortype = 0;
If (num. equals (""))
{
Errortype = 1;
Response. sendRedirect ("enter. jsp? Errortype = "+ errortype );

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.