国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)

這篇具有很好參考價(jià)值的文章主要介紹了JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

數(shù)據(jù)庫(kù) sqlserver

Create database student
go
use student
go
create table class(
	bjbh char(9) primary key,
	bjmc varchar(20) not null
)
go
insert into class(bjbh,bjmc) values('200201011','02計(jì)應(yīng)一')
go
insert into class(bjbh,bjmc) values('200201012','02計(jì)應(yīng)二')
go

create table score(
    xh char(11) primary key,
	xm char(10) not null,
	yw decimal(6,2) not null,
	sx decimal(6,2) not null,
	yy decimal(6,2) not null,
	zf decimal(6,2) ,
	bh char(9) not null
)
go
insert into score(xh,xm,yw,sx,yy,zf,bh) values('20020101101','張三',85,89,76,250,'200201011')
go
insert into score(xh,xm,yw,sx,yy,zf,bh) values('20020101102','李四',79,78,79,236,'200201011')
go
insert into score(xh,xm,yw,sx,yy,zf,bh) values('20020101201','王五',82,75,67,224,'200201012')
go

JSP代碼

XsCjZj.jsp

JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)

?

<%--
  Created by IntelliJ IDEA.
  User: ruiling
  Date: 2022/10/27
  Time: 14:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=gb2312" language="java" %>
<%@ page import="java.sql.*" %>
<%request.setCharacterEncoding("gb2312");%>
<script language="JavaScript">
    function check(theForm)
    {
        if(theForm.xh.value.length!=11){
            alert("學(xué)號(hào)必須為11位");
            theForm.xh.focus();
            return (false);
        }
        if(theForm.xm.value==""){
            alert("請(qǐng)輸入姓名");
            theForm.xm.focus();
            return (false);
        }
        if(theForm.yw.value==""){
            alert("請(qǐng)輸入語(yǔ)文成績(jī)");
            theForm.yw.focus();
            return (false);
        }
        if(theForm.sx.value==""){
            alert("請(qǐng)輸入數(shù)學(xué)成績(jī)");
            theForm.sx.focus();
            return (false);
        }
        if(theForm.yy.value==""){
            alert("請(qǐng)輸入英語(yǔ)成績(jī)");
            theForm.yy.focus();
            return (false);
        }
        return (true);
    }
</script>
<html>
<head>
    <title>學(xué)生成績(jī)?cè)黾?lt;/title>
</head>
<body>
<div align="center">
    <p>學(xué)生成績(jī)?cè)黾?lt;/p>
    <form id="form1" name="form1" method="post" action="XsCjZj0.jsp" onsubmit="return check(this)">
        <table border="1">
            <%
                    //1.加載驅(qū)動(dòng)
                    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
                    System.out.println("加載驅(qū)動(dòng)成功!");
                    String url = "jdbc:sqlserver://localhost:1433;DatabaseName=student";
                    Connection conn= DriverManager.getConnection(url, "sa", "123456");//password為密碼
                    System.out.println("連接數(shù)據(jù)庫(kù)成功!");
                    String sql="select * from class order by bjmc";
                    Statement stmt = conn.createStatement();
                    ResultSet rs=stmt.executeQuery(sql);
            %>
            <tr><td>班級(jí)</td>
                <td><select name="bjbh">
                    <%  while(rs.next())
                    {
                        String bjbh=rs.getString("bjbh");
                        String bjmc=rs.getString("bjmc");%>
                    <option value="<%=bjbh%>"><%=bjmc%></option>
                    <%
                        }
                        rs.close();
                        stmt.close();
                        conn.close();
                    %>
                </select></td>
            </tr>
            <tr><td>學(xué)號(hào)</td><td><input name="xh" type="text" id="xh"/></td></tr>
            <tr><td>姓名</td><td><input name="xm" type="text" id="xm"/></td></tr>
            <tr><td>語(yǔ)文</td><td><input name="yw" type="text" id="yw"/></td></tr>
            <tr><td>數(shù)學(xué)</td><td><input name="sx" type="text" id="sx"/></td></tr>
            <tr><td>英語(yǔ)</td><td><input name="yy" type="text" id="yy"/></td></tr>
        </table>
        <input name="submit" type="submit" value="確定"/>
        <input name="reset" type="reset" value="重置">
    </form>
</div>
</body>
</html>

JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)

?JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)

?XsCjZj0.jsp

<%--
  Created by IntelliJ IDEA.
  User: ruiling
  Date: 2022/10/27
  Time: 14:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=gb2312" language="java" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.math.BigInteger" %>
<%request.setCharacterEncoding("gb2312"); %>
<html>
<head><title></title></head>
<body>
<%
    String xh =  request.getParameter("xh");
    String xm =  request.getParameter("xm");
    String bh =  request.getParameter("bjbh");
    String yw =  request.getParameter("yw");
    String sx =  request.getParameter("sx");
    String yy =  request.getParameter("yy");
    String zf=new BigInteger(yw).add(new BigInteger(sx)).add(new BigInteger(yy)).toString();
    //測(cè)試
    //out.print(xh+" "+xm+" "+bh+" "+yw+" "+sx+" "+yy);
    try {
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        String url="jdbc:sqlserver://localhost:1433;DatabaseName=student";
        String user="sa";
        String password="123456";
        Connection conn=DriverManager.getConnection(url,user,password);
		String sql="insert into score(xh,xm,bh,yw,sx,yy,zf) values(?,?,?,?,?,?,?)";
		PreparedStatement stmt=conn.prepareStatement(sql);
		stmt.setString(1,xh);
		stmt.setString(2,xm);
		stmt.setString(3,bh);
		stmt.setFloat(4,Float.valueOf(yw));
		stmt.setFloat(5,Float.valueOf(sx));
		stmt.setFloat(6,Float.valueOf(yy));
        stmt.setFloat(7,Float.valueOf(zf));
		int n = stmt.executeUpdate();
        if (n>0){
            out.print("學(xué)生成績(jī)記錄增加成功!");
        }
        else {
            out.print("學(xué)生成績(jī)記錄增加失敗!");
        }
        stmt.close();
        conn.close();
    }
    catch (Exception e) {
        out.print(e.toString());
    }
%>
</body>
</html>

XsCx.jsp

JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)

?

JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)

?

<%--
  Created by IntelliJ IDEA.
  User: ruiling
  Date: 2022/10/27
  Time: 16:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=GB2312" language="java" %>
<%@ page import="java.sql.*"%>
<%request.setCharacterEncoding("gb2312"); %>
<html>
<head><title>學(xué)生查詢</title></head>
<body>
<%
    try {
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        String url="jdbc:sqlserver://localhost:1433;DatabaseName=student";
        String user="sa";
        String password="123456";
        Connection conn=DriverManager.getConnection(url,user,password);
        String sql = "select * from class order by bjmc";
        Statement stmt=conn.createStatement();
        ResultSet rs = stmt.executeQuery(sql);
%>
<form method="post" action="XsWh.jsp">
    班級(jí):
    <select name="bjbh">
        <%
            while(rs.next())
            {
                String bjbh=rs.getString("bjbh");
                String bjmc=rs.getString("bjmc");
        %>
        <option value="<%=bjbh%>"><%=bjmc%></option>
        <%
            }
        %>
    </select>
    <input name="Submit" type="submit" value="確定" />
</form>
<%
        rs.close();
        stmt.close();
        conn.close();
    }
    catch (Exception e) {
        out.print(e.toString());
    }
%>
</body>
</html>

XsWh.jsp

JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)

<%--
  Created by IntelliJ IDEA.
  User: ruiling
  Date: 2022/10/27
  Time: 16:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@ page import="java.sql.*"%>
<%request.setCharacterEncoding("utf-8"); %>
<html>
<head><title>學(xué)生維護(hù)</title></head>
<body>
<div align="center">
    <P>學(xué)生維護(hù)</P>
    <%
        String bjbh=request.getParameter("bjbh");
        String pageNo=request.getParameter("pageno");
        int pageSize=3;
        int pageCount;
        int rowCount;
        int pageCurrent;
        int rowCurrent;
        if(pageNo==null||pageNo.trim().length()==0){
            pageCurrent=1;
        }else{
            pageCurrent=Integer.parseInt(pageNo);
        }
        try {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            String url="jdbc:sqlserver://localhost:1433;DatabaseName=student";
            String user="sa";
            String password="123456";
            Connection conn=DriverManager.getConnection(url,user,password);
            String sql = "select xh,xm,bjmc,zf from class,score";
            sql=sql+" where class.bjbh=score.bh and bh='"+bjbh+"'";
            sql=sql+" order by bh";
            Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
            ResultSet rs = stmt.executeQuery(sql);
            rs.last();
            rowCount = rs.getRow();
            pageCount = (rowCount + pageSize - 1)/pageSize;
            if(pageCurrent>pageCount)
                pageCurrent=pageCount;
            if(pageCurrent<1)
                pageCurrent=1;
    %>
    <table border="1">
        <tr><td>學(xué)號(hào)</td><td>姓名</td><td>班級(jí)</td><td>總分</td><td>操作</td></tr>
        <%
            rs.beforeFirst();
            rowCurrent=1;
            while(rs.next()){
                if(rowCurrent>(pageCurrent-1)*pageSize&&rowCurrent<=pageCurrent*pageSize){
                    String xh=rs.getString("xh");
                    String xm=rs.getString("xm");
                    String bjmc=rs.getString("bjmc");
                    String zf=String.valueOf(rs.getFloat("zf"));
        %>
        <tr><td><%=xh%></td><td><%=xm%></td><td><%=bjmc%></td><td><%=zf%></td>
            <td><a href="XsXq.jsp?xh=<%=xh%>" target="_blank">詳情</a> <a href="XsXg.jsp?xh=<%=xh%>">修改</a> <a href="XsSc.jsp?xh=<%=xh%>">刪除</a></td></tr>
        <%
                }
                rowCurrent++;
            }
        %>
    </table>
    <p align="center">
    <form method="POST" action="XsWh.jsp">
        第<%=pageCurrent %>頁(yè) 共<%=pageCount %>頁(yè)&nbsp;
        <%if(pageCurrent>1){ %>
        <a href="XsWh.jsp?bjbh=<%=bjbh %>&pageno=1">首頁(yè)</a>
        <a href="XsWh.jsp?bjbh=<%=bjbh %>&pageno=<%=pageCurrent-1 %>">上一頁(yè)</a>
        <%} %>
        &nbsp;
        <%if(pageCurrent<pageCount){ %>
        <a href="XsWh.jsp?bjbh=<%=bjbh %>&pageno=<%=pageCurrent+1 %>">下一頁(yè)</a>
        <a href="XsWh.jsp?bjbh=<%=bjbh %>&pageno=<%=pageCount %>">尾頁(yè)</a>
        <%} %>
        &nbsp;跳轉(zhuǎn)到第<input type="text" name="pageno" size="3" maxlength="5">頁(yè)<input name="submit" type="submit" value="GO">
        <input name="bjbh" type="hidden" value="<%=bjbh %>">
    </form>
    <%
            rs.close();
            stmt.close();
            conn.close();
        }
        catch(ClassNotFoundException e)
        {
            out.println(e.getMessage());
        }
        catch(SQLException e)
        {
            out.println(e.getMessage());
        }
        catch (Exception e) {
            out.print(e.toString());
        }
    %>
</div>
</body>
</html>

XsXq.jsp

JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)

<%--
  Created by IntelliJ IDEA.
  User: ruiling
  Date: 2022/10/27
  Time: 16:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=gb2312" language="java" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.text.*"%>
<%request.setCharacterEncoding("gb2312"); %>
<html>
<head><title>學(xué)生信息</title></head>
<body>
<div align="center">
    <P>學(xué)生信息</P>
    <%
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        String url="jdbc:sqlserver://localhost:1433;DatabaseName=student";
        String user="sa";
        String password="123456";
        Connection conn=DriverManager.getConnection(url,user,password);
        String xh0=request.getParameter("xh").trim();
        String sql0 = "select * from score where xh='"+xh0+"'";
        Statement stmt0=conn.createStatement();
        ResultSet rs0 = stmt0.executeQuery(sql0);
        rs0.next();
        String xm0=rs0.getString("xm").trim();
        String bh0=rs0.getString("bh").trim();
        String yw0=String.valueOf(rs0.getFloat("yw"));
        String sx0=String.valueOf(rs0.getFloat("sx"));
        String yy0=String.valueOf(rs0.getFloat("yy"));
        String zf0=String.valueOf(rs0.getFloat("zf"));
        rs0.close();
        stmt0.close();
    %>
    <form id="form1" name="form1" method="post" action="">
        <table border="1">
            <%
                String sql = "select * from class order by bjbh";
                Statement stmt=conn.createStatement();
                ResultSet rs = stmt.executeQuery(sql);
            %>
            <tr><td>班級(jí)</td>
                <td><select name="bh" disabled="disabled">
                    <%
                        while(rs.next())
                        {
                            String bjbh=rs.getString("bjbh").trim();
                            String bjmc=rs.getString("bjmc").trim();
                    %>
                    <option value="<%=bjbh%>" <% if (bh0.equals(bjbh)){ %> selected <% } %>><%=bjmc%></option>
                    <%
                        }
                        rs.close();
                        stmt.close();
                        conn.close();
                    %>
                </select></td></tr>
                <tr><td>姓名</td><td><input name="xm" type="text" id="xm" value="<%=xm0%>" /></td></tr>
            <tr><td>學(xué)號(hào)</td><td><input name="xh" type="text" id="xh" value="<%=xh0%>" /></td></tr>
            <tr><td>語(yǔ)文</td><td><input name="yw" type="text" id="yw" value="<%=yw0%>" /></td></tr>
            <tr><td>數(shù)學(xué)</td><td><input name="sx" type="text" id="sx" value="<%=sx0%>" /></td></tr>
            <tr><td>英語(yǔ)</td><td><input name="yy" type="text" id="yy" value="<%=yy0%>" /></td></tr>
            <tr><td>總分</td><td><input name="zf" type="text" id="zf" value="<%=zf0%>" /></td></tr>
        </table>
        <br>
        <a href="javascript:window.close()" >[關(guān)閉]</a>
    </form>
</div>
</body>
</html>

?XsXg.jsp

JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)

?

<%--
  Created by IntelliJ IDEA.
  User: ruiling
  Date: 2022/10/27
  Time: 18:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.text.*"%>
<%@ page import="java.math.BigInteger" %>
<%request.setCharacterEncoding("utf-8"); %>
<script language="JavaScript">
    function check(theForm)
    {
        if(theForm.xh.value.length!=11){
            alert("學(xué)號(hào)必須為11位");
            theForm.xh.focus();
            return (false);
        }
        if(theForm.xm.value==""){
            alert("請(qǐng)輸入姓名");
            theForm.xm.focus();
            return (false);
        }
        if(theForm.yw.value==""){
            alert("請(qǐng)輸入語(yǔ)文成績(jī)");
            theForm.yw.focus();
            return (false);
        }
        if(theForm.sx.value==""){
            alert("請(qǐng)輸入數(shù)學(xué)成績(jī)");
            theForm.sx.focus();
            return (false);
        }
        if(theForm.yy.value==""){
            alert("請(qǐng)輸入英語(yǔ)成績(jī)");
            theForm.yy.focus();
            return (false);
        }
        return (true);
    }
</script>
<html>
<head><title>?學(xué)生修改</title></head>
<body>
<div align="center">
    <P>學(xué)生修改</P>
    <%
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        String url="jdbc:sqlserver://localhost:1433;DatabaseName=student";
        String user="sa";
        String password="123456";
        Connection conn=DriverManager.getConnection(url,user,password);
        String xh0=request.getParameter("xh").trim();
        String sql0 = "select * from score where xh='"+xh0+"'";
        Statement stmt0=conn.createStatement();
        ResultSet rs0 = stmt0.executeQuery(sql0);
        rs0.next();
        String xm0=rs0.getString("xm").trim();
        String bh0=rs0.getString("bh").trim();
        String yw0=String.valueOf(rs0.getFloat("yw"));
        String sx0=String.valueOf(rs0.getFloat("sx"));
        String yy0=String.valueOf(rs0.getFloat("yy"));
        rs0.close();
        stmt0.close();
    %>
    <form id="form1" name="form1" method="post" action="XsXg0.jsp" onSubmit="return check(this)">
        <table border="1">
            <%
                String sql = "select * from class order by bjbh";
                Statement stmt=conn.createStatement();
                ResultSet rs = stmt.executeQuery(sql);
            %>
            <tr><td>班級(jí)</td>
                <td><select name="bh>
                    <%
                        while(rs.next())
                        {
                            String bjbh=rs.getString("bjbh").trim();
                            String bjmc=rs.getString("bjmc").trim();
                    %>
                    <option value="<%=bjbh%>" <% if (bh0.equals(bjbh)){ %> selected <% } %>><%=bjmc%></option>
                    <%
                        }
                        rs.close();
                        stmt.close();
                        conn.close();
                    %>
                </select>
                </td></tr>
            <tr><td>學(xué)號(hào)</td><td><input name="xh" type="text" id="xh" value="<%=xh0%>" /></td></tr>
            <tr><td>姓名</td><td><input name="xm" type="text" id="xm" value="<%=xm0%>" /></td></tr>
            <tr><td>語(yǔ)文</td><td><input name="yw" type="text" id="yw" value="<%=yw0%>" /></td></tr>
            <tr><td>數(shù)學(xué)</td><td><input name="sx" type="text" id="sx" value="<%=sx0%>" /></td></tr>
            <tr><td>英語(yǔ)</td><td><input name="yy" type="text" id="yy" value="<%=yy0%>" /></td></tr>
        </table>
        <br>
        <input name="submit" type="submit"  value="確定" />
        <input name="reset" type="reset" value="重置" />
    </form>
</div>
</body>
</html>

XsXg0.jsp

<%--
  Created by IntelliJ IDEA.
  User: ruiling
  Date: 2022/10/27
  Time: 18:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.math.BigInteger" %>
<%request.setCharacterEncoding("utf-8"); %>
<html>
<head><title></title></head>
<body>
<%
    String xh =  request.getParameter("xh");
    String xm =  request.getParameter("xm");
    String bh =  request.getParameter("bjbh");
    String yw =  request.getParameter("yw");
    String sx =  request.getParameter("sx");
    String yy =  request.getParameter("yy");
    try {
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        String url="jdbc:sqlserver://localhost:1433;DatabaseName=student";
        String user="sa";
        String password="123456";
        Connection conn=DriverManager.getConnection(url,user,password);
        String zf=new BigInteger(yw).add(new BigInteger(sx)).add(new BigInteger(yy)).toString();
		String sql="update score set xm=?,yw=?,sx=?,yy=?,zf=? where xh=?";
		PreparedStatement stmt=conn.prepareStatement(sql);
        stmt.setString(1,xm);
        stmt.setFloat(2,Float.valueOf(yw));
        stmt.setFloat(3,Float.valueOf(sx));
        stmt.setFloat(4,Float.valueOf(yy));
        stmt.setFloat(5,Float.valueOf(zf));
        stmt.setString(6,xh);
		int n = stmt.executeUpdate();
        if (n>0){
            out.print("<script Lanuage='JavaScript'>window.alert('學(xué)生修改成功!')</script>");
            out.print("<script Lanuage='JavaScript'>window.location ='XsCx.jsp'</script>");
        }
        else {
            out.print("<script Lanuage='JavaScript'>window.alert('學(xué)生修改失敗!')</script>");
            out.print("<script Lanuage='JavaScript'>window.location ='XsCx.jsp'</script>");
        }
        stmt.close();
        conn.close();
    }
    catch (Exception e) {
        out.print(e.toString());
    }
%>
</body>
</html>

XsSc.jsp

JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)

?

<%--
  Created by IntelliJ IDEA.
  User: ruiling
  Date: 2022/10/27
  Time: 16:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=gb2312" language="java" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.text.*"%>
<%request.setCharacterEncoding("gb2312"); %>
<html>
<head><title>學(xué)生刪除</title></head>
<body>
<div align="center">
    <P>學(xué)生刪除</P>
    <%
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        String url="jdbc:sqlserver://localhost:1433;DatabaseName=student";
        String user="sa";
        String password="123456";
        Connection conn=DriverManager.getConnection(url,user,password);
        String xh0=request.getParameter("xh").trim();
        String sql0 = "select * from score where xh='"+xh0+"'";
        Statement stmt0=conn.createStatement();
        ResultSet rs0 = stmt0.executeQuery(sql0);
        rs0.next();
        String xm0=rs0.getString("xm").trim();
        String bh0=rs0.getString("bh").trim();
        String yw0=String.valueOf(rs0.getFloat("yw"));
        String sx0=String.valueOf(rs0.getFloat("sx"));
        String yy0=String.valueOf(rs0.getFloat("yy"));
        rs0.close();
        stmt0.close();
    %>

    <form id="form1" name="form1" method="post" action="XsSc0.jsp" onSubmit="return check(this)">
        <table border="1">
            <%
                String sql = "select * from class order by bjbh";
                Statement stmt=conn.createStatement();
                ResultSet rs = stmt.executeQuery(sql);
            %>
            <tr><td>班級(jí)</td>
                <td><select name="bh">
                    <%
                        while(rs.next())
                        {
                            String bjbh=rs.getString("bjbh").trim();
                            String bjmc=rs.getString("bjmc").trim();
                    %>
                    <option value="<%=bjbh%>" <% if (bh0.equals(bjbh)){ %> selected <% } %>><%=bjmc%></option>
                    <%
                        }
                        rs.close();
                        stmt.close();
                        conn.close();
                    %>
                </select>
                </td></tr>
            <tr><td>學(xué)號(hào)</td><td><input name="xh" type="text" id="xh" value="<%=xh0%>" /></td></tr>
            <tr><td>姓名</td><td><input name="xm" type="text" id="xm" value="<%=xm0%>" /></td></tr>
            <tr><td>語(yǔ)文</td><td><input name="yw" type="text" id="yw" value="<%=yw0%>" /></td></tr>
            <tr><td>數(shù)學(xué)</td><td><input name="sx" type="text" id="sx" value="<%=sx0%>" /></td></tr>
            <tr><td>英語(yǔ)</td><td><input name="yy" type="text" id="yy" value="<%=yy0%>" /></td></tr>
        </table>
        <br>
        <input name="submit" type="submit"  value="提交" />
        <input name="reset" type="reset" value="重置" />
    </form>
</div>
</body>
</html>

JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-508313.html

XsSc0.jsp

<%--
  Created by IntelliJ IDEA.
  User: ruiling
  Date: 2022/10/27
  Time: 19:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=gb2312" language="java" %>
<%@ page import="java.sql.*"%>
<%request.setCharacterEncoding("gb2312"); %>
<html>
<head><title></title></head>
<body>
<%
    String xh =  request.getParameter("xh");
    try {
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        String url="jdbc:sqlserver://localhost:1433;DatabaseName=student";
        String user="sa";
        String password="123456";
        Connection conn=DriverManager.getConnection(url,user,password);
        String sql = "delete from score";
        sql=sql+" where xh='"+xh+"'";
        Statement stmt=conn.createStatement();
        int n = stmt.executeUpdate(sql);
        if (n>0){
            out.print("<script Lanuage='JavaScript'>window.alert('學(xué)生刪除成功!')</script>");
            out.print("<script Lanuage='JavaScript'>window.location ='XsCx.jsp'</script>");
        }
        else {
            out.print("<script Lanuage='JavaScript'>window.alert('學(xué)生刪除失敗!')</script>");
            out.print("<script Lanuage='JavaScript'>window.location ='XsCx.jsp'</script>");
        }
        stmt.close();
        conn.close();
    }
    catch (Exception e) {
        out.print(e.toString());
    }
%>
</body>
</html>

?

到了這里,關(guān)于JSP設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)生成績(jī)管理系統(tǒng)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 用PHP寫(xiě)一個(gè)學(xué)生成績(jī)管理系統(tǒng)-基礎(chǔ)版

    在開(kāi)始編寫(xiě)代碼前,首先需要在MySQL數(shù)據(jù)庫(kù)中創(chuàng)建一個(gè)名為student的表,并添加id、name、math、english、science五列,分別用于存儲(chǔ)學(xué)生ID、姓名、數(shù)學(xué)成績(jī)、英語(yǔ)成績(jī)和科學(xué)成績(jī)的數(shù)據(jù)。具體SQL命令如下: 接下來(lái),我們使用PHP來(lái)實(shí)現(xiàn)一個(gè)學(xué)生成績(jī)管理系統(tǒng)。首先創(chuàng)建一個(gè)名為ind

    2024年02月12日
    瀏覽(18)
  • JSP 學(xué)生成績(jī)查詢管理系統(tǒng)eclipse開(kāi)發(fā)sql數(shù)據(jù)庫(kù)serlvet框架bs模式j(luò)ava編程MVC結(jié)構(gòu)

    JSP 學(xué)生成績(jī)查詢管理系統(tǒng)eclipse開(kāi)發(fā)sql數(shù)據(jù)庫(kù)serlvet框架bs模式j(luò)ava編程MVC結(jié)構(gòu)

    一、源碼特點(diǎn) ? JSP 學(xué)生成績(jī)查詢管理系統(tǒng) 是一套完善的web設(shè)計(jì)系統(tǒng),對(duì)理解JSP java編程開(kāi)發(fā)語(yǔ)言有幫助,比較流行的servlet框架系統(tǒng)具有完整的源代碼和數(shù)據(jù)庫(kù),eclipse開(kāi)發(fā)系統(tǒng)主要采用B/S模式 開(kāi)發(fā)。 java 學(xué)生成績(jī)查詢管理系統(tǒng) 代碼下載鏈接 https://download.csdn.net/download/qq_412

    2024年02月05日
    瀏覽(30)
  • 【期末課程設(shè)計(jì)】學(xué)生成績(jī)管理系統(tǒng)

    【期末課程設(shè)計(jì)】學(xué)生成績(jī)管理系統(tǒng)

    因其獨(dú)特,因其始終如一 文章目錄 一、學(xué)生成績(jī)管理系統(tǒng)介紹 二、學(xué)生成績(jī)管理系統(tǒng)設(shè)計(jì)思路 三、源代碼 1.?test.c? 2.?Student Management System.c 3.Stu_System.c 4.Teacher.c 5.Student Management System.h?? 前言: 學(xué)生成績(jī)管理系統(tǒng)含教師登錄入口和學(xué)生登錄入口,可實(shí)現(xiàn)學(xué)生信息的添加,刪

    2024年02月16日
    瀏覽(22)
  • Java設(shè)計(jì)學(xué)生成績(jī)管理系統(tǒng)

    Java設(shè)計(jì)學(xué)生成績(jī)管理系統(tǒng)

    1.1 題目與要求 設(shè)計(jì)一個(gè)學(xué)生成績(jī)排名系統(tǒng) 實(shí)現(xiàn)以下功能: (1) 具備對(duì)成績(jī)的管理功能(添加、刪除、排序); (2) 具備對(duì)成績(jī)的統(tǒng)計(jì)功能(最高分,最低分,平均分,及格率等); (3) 具備按學(xué)號(hào)、姓名查詢成績(jī)的功能; (4) 具備處理解決學(xué)號(hào)重復(fù)問(wèn)題 ; 備注:成績(jī)記錄以下

    2024年02月09日
    瀏覽(25)
  • 用Java創(chuàng)建一個(gè)學(xué)生成績(jī)管理系統(tǒng)登陸界面(初級(jí))

    用Java創(chuàng)建一個(gè)學(xué)生成績(jī)管理系統(tǒng)登陸界面(初級(jí))

    目錄 任務(wù)與要求 代碼部分 部分代碼: 完整代碼: 使用eclipse.exe創(chuàng)建一個(gè)登錄界面,如圖1所示,當(dāng)用戶名輸入“l(fā)ili”,密碼輸入“123456”后,彈出主菜單窗體,如圖2(a)所示。鼠標(biāo)箭頭在主菜單窗體點(diǎn)“操作菜單”會(huì)彈出操作子菜單窗體,如圖2(b)所示。鼠標(biāo)箭頭在主菜單

    2024年02月11日
    瀏覽(28)
  • Java課程設(shè)計(jì)——學(xué)生成績(jī)管理系統(tǒng)

    Java課程設(shè)計(jì)——學(xué)生成績(jī)管理系統(tǒng)

    1 需求分析 1.1 需求分析概述 需求分析是開(kāi)發(fā)軟件系統(tǒng)的重要環(huán)節(jié),是系統(tǒng)開(kāi)發(fā)的第一步和基礎(chǔ)環(huán)節(jié)。通過(guò)需求分析充分認(rèn)識(shí)系統(tǒng)的目標(biāo)、系統(tǒng)的各個(gè)組成部分、各部分的任務(wù)職責(zé)、工作流程、工作中使用的各種數(shù)據(jù)及數(shù)據(jù)結(jié)構(gòu)、各部門(mén)的業(yè)務(wù)關(guān)系和數(shù)據(jù)流程等, 為系統(tǒng)設(shè)計(jì)

    2024年02月03日
    瀏覽(23)
  • C++課程設(shè)計(jì)——學(xué)生成績(jī)管理系統(tǒng)

    C++課程設(shè)計(jì)——學(xué)生成績(jī)管理系統(tǒng)

    今天清理電腦偶爾發(fā)現(xiàn)一個(gè)我剛學(xué)編程時(shí)用c++寫(xiě)的一份課程設(shè)計(jì),使用到簡(jiǎn)單的鏈表,結(jié)構(gòu)體,c++類與對(duì)象的知識(shí)——學(xué)生成績(jī)管理系統(tǒng)。 ~~ 系統(tǒng)結(jié)構(gòu): 管理員模式 教師模式 學(xué)生模式 實(shí)現(xiàn)了對(duì)學(xué)生成績(jī)及信息的增刪改查以及排序。 效果圖 主菜單 管理員模式菜單 源代碼

    2024年02月16日
    瀏覽(22)
  • ChatGPT實(shí)現(xiàn)用C語(yǔ)言寫(xiě)一個(gè)學(xué)生成績(jī)管理系統(tǒng)

    隨著ChatGPT爆火,大家都在使用ChatGPT來(lái)幫助自己提高效率,對(duì)于程序員來(lái)說(shuō)使用它來(lái)寫(xiě)代碼怎么樣呢?今天嘗試讓ChatGPT,寫(xiě)了一個(gè)學(xué)生成績(jī)管理系統(tǒng)。 問(wèn)題是:使用C語(yǔ)言寫(xiě)一個(gè)學(xué)生成績(jī)管理系統(tǒng),要求使用鏈表,實(shí)現(xiàn)增刪改查功能。 下面是ChatGPT寫(xiě)的代碼,用時(shí)不到30秒,速

    2023年04月13日
    瀏覽(95)
  • 【Java程序設(shè)計(jì)】學(xué)生成績(jī)管理系統(tǒng)

    【Java程序設(shè)計(jì)】學(xué)生成績(jī)管理系統(tǒng)

    ?相關(guān)文章: 【Java程序設(shè)計(jì)】寵物商店管理系統(tǒng) 【Java程序設(shè)計(jì)】Java基礎(chǔ)知識(shí)實(shí)驗(yàn) 對(duì)于學(xué)生成績(jī)管理系統(tǒng),主要可以分為如下幾個(gè)功能: 錄入學(xué)生成績(jī) 統(tǒng)計(jì)學(xué)生成績(jī) 查找學(xué)生成績(jī) 修改學(xué)生成績(jī) 刪除學(xué)生成績(jī) 按平均分排序 顯示所有成績(jī) 退出管理系統(tǒng) 進(jìn)入系統(tǒng)之后,我們

    2024年01月17日
    瀏覽(33)
  • C語(yǔ)言課程設(shè)計(jì)-學(xué)生成績(jī)管理系統(tǒng)

    C語(yǔ)言課程設(shè)計(jì)-學(xué)生成績(jī)管理系統(tǒng)

    需求分析: 1.設(shè)計(jì)題目:學(xué)生成績(jī)管理系統(tǒng) 2.系統(tǒng)功能需求分析:實(shí)現(xiàn)對(duì)學(xué)生各科成績(jī)總分及平均分的排序,和成績(jī)的查找 概要設(shè)計(jì) 1. 功能模塊圖 詳細(xì)設(shè)計(jì) 1. 流程圖 測(cè)試結(jié)果 :列出所有功能的運(yùn)行界面,并作文字說(shuō)明。 1.錄入成績(jī):錄入3個(gè)人的學(xué)號(hào)和各科成績(jī) 2.每門(mén)課程

    2024年02月11日
    瀏覽(25)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包